2,777 Posted Topics

Member Avatar for nah094020

Have you looked at the tutorial? http://docs.oracle.com/javase/tutorial/extra/generics/index.html Please post the full text of any error messages you are getting when you compile the code.

Member Avatar for NormR1
0
2K
Member Avatar for minimee120

You're probably having problems with the way the Scanner class works. Some times it returns an empty line when you use nextLine() after using next(). Printing out the values of the data read from the user will show if you are reading data as you want. Be sure to add …

Member Avatar for NormR1
0
249
Member Avatar for Julie29

Lots of people here to help. Can you explain your problem? Post the code you are having problems with and ask any questions you have.

Member Avatar for JamesCherrill
0
7K
Member Avatar for OsaidAz

You would need to use nested loops. Inside the inner loop, index elements in the array. If they are 0, change to 1. If 1 skip it. Count the numer of changes made and exit when done.

Member Avatar for OsaidAz
0
146
Member Avatar for abinaya.lingam

Please post the code you are having problems with, your questions and the full text of the error messages.

Member Avatar for JamesCherrill
0
365
Member Avatar for Murphyv10

> i understand the problem Could you explain what the problem is? Post the full text of any error messages.

Member Avatar for NormR1
0
196
Member Avatar for Rami Sohail

Line 29 sets the array element to a 1. How often should that line be executed? What code controls how often that line is exceuted? You should not hardcode numbers to control for loops. See the 3 in line 17 and the 7 in line 19. These values should either …

Member Avatar for Taywin
0
4K
Member Avatar for babi.meloo

int digitValue = ch - 48; // now the number is really 2 Poorly documented code. Who knows what 48 is. Better would be: int digitValue = ch - '0'; // now the number is really 3

Member Avatar for NormR1
0
3K
Member Avatar for Blax

[QUOTE]irlce.java:23: incompatible types found : java.io.IOException required: char letter = get.ioException(); ^[/QUOTE] The error message says it all. What does the get object's ioException() method return? Is it the same type as the variable letter? What are you using the ioException() method for? lce.java:37: possible loss of precision found : …

Member Avatar for stultuske
0
287
Member Avatar for oneoderja

Is this the same question: http://www.daniweb.com/software-development/java/threads/436236/sales-receipt-program-from-cash-register-program Please don't start a new thread for the same question

Member Avatar for stultuske
0
294
Member Avatar for Marty1963

> I need to get a visitors location Where is that information available? Can you have the visitor/user select it from a list? Or type it into a textfield?

Member Avatar for chrislim2888
0
153
Member Avatar for oneoderja

What are you having problems with converting the posted code? Do you have any specific questions? Two things I see that you need: Ask user for data. Scanner class can help write data to file. See the PrintWriter class

Member Avatar for stultuske
0
3K
Member Avatar for Gen.Asura

Can you give some examples of the type of expressions you are looking for. A technique for getting random operators would be to put them into an array and use a random number generator for selecting the operator.

Member Avatar for JamesCherrill
0
175
Member Avatar for Beastegargoyle

Reading the API doc for the method you are using should help you understand what it does. If you have questions about what it says, copy the text of the doc here and ask your questions.

Member Avatar for NormR1
0
321
Member Avatar for kupogu
Member Avatar for KronoAngel

Try debugging the code by printing out the values that control what is added to the order variable. Add lots of printlns statements. When using if/else if statements the first one that is true will be the ONLY one that is executed. Make sure the variables are tested in the …

Member Avatar for stultuske
0
321
Member Avatar for ibthevivin

> Any suggested place to start? Post the full text of the error messages so we can see what the problems are.

Member Avatar for NormR1
0
269
Member Avatar for nsharif

By "map" do you mean a background image that is drawn and filled in as it is moved? For example if the background is moved down, new background is drawn in on the top.

Member Avatar for nsharif
0
110
Member Avatar for shawn.crego

> how to replace the proper "*" with the guessed letter Where are the "*"s for the letters in the word stored? If they are in a String like this: "****", you could use methods in the String class to get the substring before the letter to replace and the …

Member Avatar for NormR1
0
247
Member Avatar for techxaidz

> how i can test if it is checked You would use a syntax like this to call a check box's method: `referenceToCheckBox.methodThatSaysIfChecked()` an element in an array is a reference to an object and can be called the same way: `array[ix].aMethod()` See the API doc for the JCheckBox class …

Member Avatar for stultuske
0
334
Member Avatar for Ashenvale

> Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException > at hospitalbilling.PatientAddress.searchInfo(PatientAddress.java:32) There is a variable on line 32 with a null value.

Member Avatar for NormR1
0
99
Member Avatar for phil.sutton

> NullPointerException in Main Class.java:39 Look at line 39 in Main_Class and find the variable that has a null value. Then backtrack in the code to find out why that variable does not have a valid non-null value.

Member Avatar for NormR1
0
324
Member Avatar for sharonC

Please post the full text of the error message. Note: Exceptions are thrown when the code is executed, not by the compiler.

Member Avatar for NormR1
0
255
Member Avatar for cafegeo
Member Avatar for akinfemi
Member Avatar for Dane2259

> when the if statement doesn't run my trail variable doesn't get incremented. Where do you assign any value to the trail variable inside the if statement? If you don't assign it a value its value does not change. Can you post the code's output and add some comments to …

Member Avatar for Starstreak
0
155
Member Avatar for Viped

Are you asking how and when the OS and jvm send key pressed event data to your program? Try some debugging by adding a println to the keyReleased() method to see when it is called.

Member Avatar for Viped
0
179
Member Avatar for sapure

> why the upper two lines of code produce error! Please post the full text of the error message. One problem is that your class has the same name as a Java SE class. Changing the name of your class should fix those errors.

Member Avatar for NormR1
0
204
Member Avatar for summey

> how to distiguish if the user input was a string or a int. Several ways to use the Scanner class. It has methods that will test what the user has typed in before the program tries to read in the data. These methods all begin with these 3 letters: …

Member Avatar for summey
0
1K
Member Avatar for joseph.henriquez

Where is the println statement that prints out the null? What is the value of the roll variable that is returned by the roll() method?

Member Avatar for Taywin
0
153
Member Avatar for revertedlogic

> I keep getting some errors Please copy the full text of the error messages and paste them here. > I feel like I am missing an else or some curly braces For curly braces, some IDEs have a "Find matching" feature. Put the curosr before one, press some keys …

Member Avatar for Taywin
0
248
Member Avatar for dantheman4

Have you written any test programs and added these code segments to them to see how they execute? Compile and execute the code to see what the results are.

Member Avatar for JamesCherrill
-1
159
Member Avatar for crownedzero

Can you iterate through the collection, test each object and put it in one of the new lists based on its value?

Member Avatar for Taywin
0
220
Member Avatar for chamo0683

> read from a file text Where in the code are you trying to read from a file? For simple text files the Scanner class could do it. > store the person data into an array list Where is the arraylist for the person data?

Member Avatar for NormR1
0
1K
Member Avatar for sk8ergirl
Member Avatar for bigredaltoid

> why my regionsareValid method won't work. Try debugging the code. One technique is to add println statements to print out the values of variables as there values are changed and used. Where in the faulty method does the test fail to find the invalid data? Add some printlns there …

Member Avatar for Taywin
0
377
Member Avatar for JavaDroid
Member Avatar for minimee120

> how would I make it so that the program keeps running and doesn't stop after 1 user input Put the code inside of a loop like a while loop. Stay in the loop until the all the user input has been read. Please edit your post and format the …

Member Avatar for NormR1
0
2K
Member Avatar for ToneZ

> it still won't work. Can you explain what "won't work" means? If there are errors, copy and paste the full text here. If the results are wrong, copy and paste them here and explain what is wrong with them. To see what the code is doing add some println …

Member Avatar for Taywin
0
318
Member Avatar for minimee120

> Having some trouble Please explain. What happens when you compile and execute the program? If there are any errors, please copy and paste the full text here. If the program executes, please copy the full contents of the command prompt window and paste it here. To copy the contents …

Member Avatar for Taywin
0
139
Member Avatar for ali11

> not sure why getting error Please copy the full text of the error message and paste here.

Member Avatar for Taywin
0
244
Member Avatar for Hemanth.Satkuri

Yes, you should be able to write a program with those options. I don't know if you can set the response type if that is an OS setting.

Member Avatar for NormR1
0
252
Member Avatar for sapure

Do you know how to start (invoke) a java program by entering a command line on a command prompt window? For example: java TheClass thearg "thearg" is passed in the String[] args array passed to the main() method.

Member Avatar for sapure
0
316
Member Avatar for k22mac

> do I need to create a new variable Try it and see what happens. You'll need a print statement for each variable.

Member Avatar for dimasalang
0
115
Member Avatar for codechrysalis

> a way for the all the methods that i have that ask for the user input need to go into the respective arrays Use a loop for each array that asks for the user's input, reads the input and stores it into the array. Is there any correspondence between …

Member Avatar for NormR1
0
212
Member Avatar for i.nikei

`array(1)="Section A"` That is not a valid method call. You can not assign a value to the call to a method. array(1) is a call to a method (the ()s) Do you mean to make an array reference? Then use []:`array[1]="Section A"`

Member Avatar for NormR1
0
140
Member Avatar for jemz

Can you put the images, etc in the jar file? Then they would always be at the same location. I use the jar command to add files to a jar file.

Member Avatar for jemz
0
415
Member Avatar for ibthevivin

One way I work out the sequence of steps a program takes is to start at the main() method and number each statement in the order it is executed. A simple start: public static void main (String[]args) { E e = new E(5); // 1 System.out.println(e.f(8,4,2)); }//main() public E(int z) …

Member Avatar for richard89AZ
0
255
Member Avatar for sk8ergirl

> have this array of string joe,DE2300,A sam,RM4901,B allay,SM9800, That doesn't look like an array. It looks like a String. To split that String up into separate Strings in an array look at the String class's split() method > want to split the array to another array What type of …

Member Avatar for sk8ergirl
0
299
Member Avatar for Yoink

There are two. One is passed in to the method and the other is the the class object that holds the method being executed. The call to the getX() method calls the local class's method for the value of x in the currrent object.

Member Avatar for NormR1
0
245

The End.