32,199 Topics

Member Avatar for
Member Avatar for rahul.ch

class Sample1 { Sample1() {System.out.println("Sample1 const"); } void doStuff(){System.out.println("sample1 dostuff"); } } class Sample2 extends Sample1 { Sample2() {System.out.println("Sample2 const"); } } public class Sample3 extends Sample2 { Sample3() {System.out.println("Sample3 const"); } public static void main(String r[]) { new Sample3().go(); } void go() { super.doStuff(); } } The output is: …

Member Avatar for rahul.ch
0
196
Member Avatar for akinfemi

hi all, been tryin to find wat is wrong with this code. It works for sometime then starts repeating the same value continuossssssly. any help will be appreciated. thanks /* THIS PROGRAM IS TO RUN A SIMULATION PROGRAM OF ARRIVAL AND SERVICE TIMES OF AN AUTO-REPAIR WORKSHOP * servTime = …

Member Avatar for Starstreak
0
133
Member Avatar for Ashenvale

Hi, i want to call frame B from Frame A private void BFrameBActionPerformed(java.awt.event.ActionEvent evt) { Frame B = new Frame B.setVisible(true); } NOTE :calling JframeB is trigerred by a jButton but when I do this FrameA overlays my Frame B. can someone help me with this?

Member Avatar for Ashenvale
0
73
Member Avatar for hokiii

Hello , i am starting with java. I need to school make program that generates random numbers 1-20 , a than make method to check duplicates and replace them ... i find on the internet only methods with array or something like that , i cant use that because i …

Member Avatar for stultuske
0
1K
Member Avatar for Boby Smith

Use document.forms[0].submit(); (0 refers to the index of the form – if you have more than one form in a page, then the first one has the index 0, second has index 1 and so on).

Member Avatar for stultuske
0
58
Member Avatar for sapure

When choosing the input file, I tried three ways & all of them generated errors ! I created the file.txt in the project's folder. I'm using Netbeans IDE. 1) Passing java ShowFile Input.text as a command-line argument [properties ---> run ---> wrote this command-line in the 'Argument' box] 2) Using …

Member Avatar for stultuske
0
201
Member Avatar for Dane2259

I'm trying to alphabetize an array by comparing the characters at position 0 of two strings in an array, but I don't understand why when the if statement doesn't run my trail variable doesn't get incremented. //alphabetize array public class AlphaArray { public static void main(String[] args) { String[] yourChoiceItems …

Member Avatar for Starstreak
0
152
Member Avatar for Viped

Hi, how is it possible to handle multiple keys at same time. I am making platformer game. Now if I push forward it goes forward until I release button or hit some else button example jump. What should I do to achieve that it wouldnt stop going forward but jumps …

Member Avatar for Viped
0
177
Member Avatar for sapure

public class BufferedReader { public static void main(String[] args) throws IOException { char c; BufferedReader sen = new BufferedReader (new InputStreamReader(System.in)); **// ERROR** System.out.println("Enter characters, 'q' to quit"); // read characters from the console while(c != 'q') { c = (char) sen.read(); **// ERROR** System.out.print(c); } } } I don't …

Member Avatar for NormR1
0
197
Member Avatar for xero_ace

I created a java web service in netbeans successfully.Then i deployed it also.But i can't right click on web service and test it.Test option appear as unclickable.Please help me.

0
91
Member Avatar for Viped

Hi, I've been making my own zelda like rpg game and the game runs actually fine, but when closing it console prints this: FATAL ERROR in native method: JDWP Can't allocate jvmti memory, jvmtiError=JVMTI_ERROR_INVALID_ENVIRONMENT(116) JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): on getting class status [../../../src/share/back/util.c:1265] JDWP exit error JVMTI_ERROR_INVALID_ENVIRONMENT(116): Can't allocate jvmti …

Member Avatar for Viped
0
184
Member Avatar for samith.dilhara

<style name="Theme.Custom" parent="android:Theme"> <item name="android:windowBackground">@drawable/progress_clip_drawable</item> <item name="android:windowNoTitle">true</item> </style> if I use image drawable it works but if I use clip or shape drawable it want please help suggest solution

Member Avatar for JorgeM
0
55
Member Avatar for coding101

i have a udp server thats going to send and mp3 file. when does the client udp know when the udpserver is done sending?

Member Avatar for JamesCherrill
0
108
Member Avatar for summey

I am trying to figure out how to distiguish if the user input was a string or a int. The out put i am looking for is please enter a string: cat please enter a string: dog please enter a string: hamster please enter a string: 1234 please enter a …

Member Avatar for summey
0
997
Member Avatar for joseph.henriquez

public String roll() { Random generate = new Random(); int diceRoll; int firstNum; int secondNum; boolean winner = false; for (int x=1; x<=3; x++) { firstNum = generate.nextInt(6)+1; secondNum = generate.nextInt(6)+1; diceRoll = firstNum + secondNum; System.out.println("Roll number " + x + " was " + diceRoll); if(userNum == diceRoll) …

Member Avatar for Taywin
0
150
Member Avatar for revertedlogic

I am just starting out with java and I have to make a decision based text game. I keep getting some errors and I feel like I am missing an else or some curly braces somewhere, any help? import java.util.*; public class TextGame { Scanner scan = new Scanner(System.in); int …

Member Avatar for Taywin
0
246
Member Avatar for adarshcu

Hi, [CODE] public void getTasksList(ArrayList<PerformTask> TasksList) { // TODO Auto-generated method stub try{ Class.forName("com.mysql.jdbc.Driver"); Connection cn=DriverManager.getConnection("jdbc:mysql:///test","root", "admin"); Statement st= cn.createStatement(); String s1 = "Select * from perform_task"; ResultSet rs = st.executeQuery(s1); System.out.println("Comes Here !! "); while(rs.next()){ rs.getDate("DateOfTask"); java.util.Date jDate = new java.util.Date(rs.getDate("DateOfTask").getTime()); TasksList.add(new PerformTask(rs.getInt("TaskID"), rs.getInt("PersonID") , jDate ,rs.getString("TaskDescription"),rs.getInt("TotalEffort"),rs.getString("TaskName"))); } }catch(Exception …

Member Avatar for rahul.pedduri
0
2K
Member Avatar for dantheman4

1.Which of the expressions below is true if and only if an array A containing three different integers is sorted in ascending order a. A[1] < A[2] || A[2] < A[3] b. A[0] < A[1] && A[1] < A[2] c. A[0] < A[1] || A[1] < A[2] d. A[1] < …

Member Avatar for JamesCherrill
-1
158
Member Avatar for rubai

I have installed jdk and eclipse. but I can't start progamming. When I start from menu> New> class, it shows at the top "Source folder name is empty." Can anyone help me? My operating system is win7 64bit

Member Avatar for rubai
0
137
Member Avatar for crownedzero

Working with polymorphism collections, list, arraylists etc. I have a sorted collection that I would like to split based on one of the objects properties. All records > 0 to one; all less than to another. I'm trying to think of the best way to implement this. I'm thinking Comparable/Comparator …

Member Avatar for Taywin
0
217
Member Avatar for chamo0683

Hi I need help with this program. I am trying to get it to store the person data into an array list and read from a file text but have not been able to figure out how to due it. This are the instructions for the program: Write an AddressBook …

Member Avatar for NormR1
0
1K
Member Avatar for suncica2222

I'm using Netbeans 7, JEE project with application client, stateless ejb with remote interface, and JPA entity clasess made from sql script. Interfaces are in separate library project which is referenced in ejb and client project. **And the problem is the remote method that use custom interface object made from …

0
185
Member Avatar for jalpesh_007

dear all, I have made one program, but i am stuck with one problem. I have taken one scrollpane in simple desktop GUI application in java. My hierarchy of Scroll pane is as below. JFrame |_JTabeedPane |_JScrollPane |_JPanelMain |_Jpanel |_JPanelA |_JPanelB Now all the components are in JPanelA and JPanelB. …

Member Avatar for jalpesh_007
0
194
Member Avatar for sk8ergirl

I've created combobox.. the user have to select from the combo class, subject or grade(A,B,C,D,F) if the user select class in the text field he should type wich class 7 grade or8grade or 9 grade if he type 7 he should get all of the student name, grade. how can …

Member Avatar for mKorbel
0
790
Member Avatar for bigredaltoid

Hi all - this is the code: package sodukupackage; import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; public class ReadSudokuValuesIntoArray { public static void main(String[] args){ int[][] sudoku = new int[9][9]; Scanner sc = null; try{ int i = 0, j = 0, count = 1; sc = new Scanner(new File("validsudoku.txt")); while …

Member Avatar for Taywin
0
361
Member Avatar for JavaDroid

I am looking for help in creating an inventory system for my text based adventure game that I am writing in java. i have shared the *.java* files here: https://docs.google.com/folder/d/0B2crBUQ5i6iBRkFpanJiRGFfMWc/edit any suggestions would be appreciated, as well as any critiques of the current code.

Member Avatar for NormR1
0
127
Member Avatar for prem2

Hi team, Can any one say what is instance Method in java ? *Method Overriding Concept? Thank you, with Regards, Prem

Member Avatar for JamesCherrill
0
2K
Member Avatar for minimee120

Here's what I have so far, I'm just having trouble writing the second part that will say that the string in the text file isn't there if the user enters a number thats not saved in the text file (data3.txt). Also how would I make it so that the program …

Member Avatar for NormR1
0
2K
Member Avatar for ToneZ

Anyways, I'm having trouble with this Cash Register code. I've been working on it for a day now, and it still won't work. Any ideas? import java.util.*; import java.io.*; public class Cash { public static void main(String[] args) { Scanner console = new Scanner(System.in); int amountDue,amountPaid; double pennies,dollars,nickels,dimes,quarters; System.out.print("The amount …

Member Avatar for Taywin
0
316
Member Avatar for rrr12345

I am thinking of something that would require extreme use of algorithms, maybe a search engine or a distributed computing systems. Any other idea for heavily algorithim based project that would of course increase my marketability ? and by the way i have 2 instead of 1 year to complete …

Member Avatar for Taywin
0
281

The End.