2,777 Posted Topics
Re: When you post error messages please post the full text of the error message showing the contents of the line and the line number. Where are ArrayStack and ArrayQueue defined? For items 3 & 4: If your Stack takes Strings you can not push other datatypes on it. | |
Re: Can you explain What do you want to do when the ServerSocket's accept() method returns a Socket with a connection? Normally you would pass that Socket to a class and method to handle it. Why can't you do that? | |
Re: [QUOTE]number of compilation errors[/QUOTE] Please copy and paste here the full text of the error messages. | |
Re: When in doubt, read the manual. In this case the API doc for the class you are using. | |
![]() | Re: How would the value of attribute get changed to 1? Your posted code does not show any reason that the value would not be 0 when you call method2. Can you show your code that will cause the value to get changed? Add a println statement after where the value … |
Re: Have you taken a piece of paper and worked out what is to be printed on each line. The number of spaces and the values of the digits for each row. Then figure out what variables you need to use to how the values of the digits as they are … | |
Re: Can you explain what your problem is? Do you have some specific questions? When you post code, please put the code in code tags. Use the CODE icon above the input box. Unformatted code is hard to read. | |
Re: [QUOTE] incompatible types found : int required: java.lang.String[] String[] arr = Integer.parseInt(mem_add[k],16);[/QUOTE] What don't you understand about this message? the compiler found an int where the datatype should be(required: ) a String What does parseInt() return? What is to the left of the = ? | |
Re: Sorry, I can not understand your problem. Can you post a small program the will compile and execute and demonstrate your problem? Your application must have at least one class that has the public static void main method in it. That method should start the application by creating other classes … | |
Re: Please show the output and explain what is wrong with it and show what you want it to be. | |
Re: Your code has third party packages in it that not everyone has making it impossible to compile and test your code. Can you make a simpler version of the program using java SE classes that demonstrates your problem. Your problem sounds like you are using the GUI's thread to do … | |
Re: Do you have any specific questions about your code? If you are getting errors, please copy and paste them here. If the output is wrong, show the output and explain what is wrong with it. | |
Re: Can you explain what the problem is. Show the output and explain what it should be. Do you get errors? If so, please copy the full text and paste it here. | |
Re: You don't post the correct answer. Will the correct answer fit into the type of variable you are using? Otherwise have you used smaller values, done the math steps manually and compared the results of your program with your manual method to see if your code is doing what you … | |
Re: Your code does not compile. You need to get a clean compile before you can execute it. Please post the full text of the compiler error messages here. | |
Re: Can you explain what your problem with more specific questions? Please edit your post and wrap the code in code tags. Use the [code] icon above the input box. | |
Re: [QUOTE]creating more servers when the program will have to wait for the thread to finish anyway?[/QUOTE] What program would be waiting? Are all the requests coming from one thread in one program? If each request is given a thread to service it, a limiting factor would be the number of … | |
Re: [CODE] if (sentence == word)[/CODE] Use the equals() method when comparing the contents of two String objects. You use == mostly with primitives like int and char. | |
Re: Have you tried getting the location of the panel and then adjusting your components positions by considering the panel's location. | |
Re: [QUOTE]where do I place it to work in my program?[/QUOTE] Put it where you detect [B]when the user fails to enter any information[/B] Where in your logic will you be sure the user has entered all the data you require so you can make this test? Does the user press … | |
Re: [QUOTE]how you can input information from one array to another[/QUOTE] You would use an assignment statement like with any other variables. Left side of = receives the value Right side of = is the source of the value ar{i] = ad[j]; | |
Re: Is this a duplicate post? [url]http://www.daniweb.com/software-development/java/threads/395733/1697767#post1697767[/url] | |
Re: The java command takes the name of a class for its argument. You have give it the filename of the source file. The class name is the name of the class not the name of the file. There is no .class in a class name. | |
Re: [QUOTE] it shows me NullPointerException...[/QUOTE] Please post the full text of the error message. It has needed info about your code. Did you find the variable that is null? Did you look back through the code to see why that variable is null and change the code so it is … | |
Re: [QUOTE]need a code for generating random numbers [/QUOTE] I see that you are using the Math class's random method and the Random class. Can you explain what your problem is? Show what the program does and explain why that is not what you want and show what you do want. | |
Re: [QUOTE]how to pass the sorted array[/QUOTE] Which array are you trying to pass to what code? Can you explain a bit more? Where do you get/define the array, where is it sorted and where do you want to pass the sorted array? | |
Re: [QUOTE] subMenu(); ^ symbol: method subMenu() location: class FerryTicketingSystem[/QUOTE] You have left off what the error was. Please post the full text of the compiler's error message. | |
Re: To debug these kinds of problems, you need either an interactive debugger or you must add lots of printlns to your code to show the logic flow and the values of the variables that are controlling the logic flow. When you print out the values of variables be sure to … | |
Re: Why are you using the Scanner class inside of the Recipe class if you want to gather the values to be used in the Recipe class's constructor? Should you get the values in another class and then call the Recipe class's constructor with those values. | |
Re: [QUOTE] I don't know how to do the arbitrary expressions[/QUOTE] There is a lot of literature that discusses how to parse expressions. This is a topic some people spend weeks studying when learning to write compilers. Perhaps you can get an algorithm from Google or Wikipedia. | |
Re: Do you have specific problems with your code? Or do you have specific questions you'd like to ask about it? [QUOTE]but got stuck in putting the boolean to terminate the program when the values entered by the user are wrong [/QUOTE] Can you high light the area where you are … | |
Re: Another way to have text be printed on more than one line is to insert a newline character ('\n') in the text at the point you want the following text to start on the next line. "Line 1\nLines 2\nLine 3" will print on 3 lines The println() method automatically adds … | |
Re: Can you explain what "messed up" means? What were we supposed to see in the posted image? | |
Re: Can you use the Scanner class to read the text file? What package is the SimpleReader class in? Is that something given you by your teacher? | |
Re: [QUOTE]map multiple values to the same 'person' without creating objects for them each time.[/QUOTE] The Map class would allow you to have many keys refer to the same object. Or you could have an array (or any container) with many of its elements pointing to the same object. [QUOTE]need to … | |
Re: Can you be more specific about your problem. If all your paint() methods are drawing on the same Graphics context, you need to pass each of them the bounds of the box that they can draw in. Your Candidate's paint method needs code to fill in the color and draw … | |
Re: [QUOTE]Member class cannot implement Comparable.[/QUOTE] You need to get the correct error messages from the java compiler. Your posted error message does NOT tell you what the problem is. Use the javac command to get the correct error message. | |
Re: [QUOTE] but it doesn't loop even if[/QUOTE] Can you show the console from when you execute your code that shows what you input and how the code executed? | |
Re: Can you post working code (SSCCE) to demo your problem? | |
Re: [QUOTE]they are of different types (int/int [])[/QUOTE] I'm not sure what your problem is. An element of an int array is an int. What did the API doc for the method you were trying to use say? Did it take an int or an array of int? Please post the … | |
Re: [QUOTE]I can't get the object array in lab9 class (named "thelist") to be populated with objects from the Foreign class[/QUOTE] Please explain. If you get errors, copy the full text of the error messages and paste them here. | |
Re: Put a println just after the main method header about line 55. [QUOTE]I can't even print[/QUOTE] If you get error messages please post the message here. | |
Re: Do the project one step at a time. You list 4 things you want to do: opens a file sorts the data saves a file and appends a file Start with the first one. Can you do that ok? If not explain your problem Then go to the second one. … | |
Re: Check the logic that controls how many numbers are printed on a row/line? Print 5 and then print a newline ![]() | |
Re: [QUOTE]IllegalArgumentException: invalid range properties[/QUOTE] You are creating the JSlider with incorrect values. You will have to post your code if you want any more help. | |
Re: Many of the problems seem to be explained by the error message. Which of the errors don't you understand? C:\Users\Hamza\Pictures\CalcGUIPanel.java:63: array required, but java.lang.String found cStack.push(buttonOrder[i]); ^ [B]What is buttonOrder? An array or ???[/B] C:\Users\Hamza\Pictures\CalcGUIPanel.java:213: currentValue is already defined in actionPerformed(java.awt.event.ActionEvent) BigInteger currentValue = new BigInteger(cStack.pop()); ^ [B]Remove one of … | |
Re: [QUOTE]how can i get label at the co-ordinates where the event has taken place.[/QUOTE] Look at the Container class's API doc. It has some methods that could be useful. | |
Re: [QUOTE]how to get the data that is read from the file and use it in the conversions since some of the data is inputted through dialog boxes[/QUOTE] One way would be to save the data in class variables where all the methods can see it. | |
Re: [QUOTE]i want to make a ftp server in Java[/QUOTE] Have you read the RFC doc for FTP? That describes the protocol. Mainly have a server socket on a certain port and wait for connection. Then in some cases move to another port for the transfers. All discussed in the RFC … | |
Re: Sounds like high school algebra. Solving an equation with 2 unknowns. A way would be a brute force nested looping program. |
The End.