1,963 Posted Topics
Re: First of all remove the lines: do{ They don't do anything. You open the bracket and you don't close it plus you don't have a while to go with it. The while that follows is unrelated with the previous 'do' and it has its own brackets. Also inside the while … | |
Re: First of all in the code you have posted you write this: [CODE] String queryString = "INSERT INTO lesson1(Name,Description)" + "VALUES (?, ?)"; [/CODE] And at the error: [CODE] String queryString = "INSERT INTO lesson1(Name,Description)" + "VALUES ("?", "?")"; [/CODE] So which one is deployed? Because the first is correct. … | |
Re: Why don't you use this tag, like everybody else: [CODE]<form method="post" action="" name="" > <input type="password" name="password"> </form>[/CODE] | |
Re: Here is what you have: [CODE] boolean stop = false; { Scanner input = new Scanner(System.in ); System.out.print( "Enter Employee's Name or stop to exit program: " ); String empName = input.nextLine(); // employee name if ( empName.equals("stop")) { System.out.println( "Program Exited" ); stop = true; } else { while … | |
Re: Assuming that I understood correctly and you need to know the type of your variable. Then if it is an Object try this: [CODE] String obj = "asd"; System.out.println(obj); System.out.println(obj.getClass()); System.out.println(obj.getClass().getName()); [/CODE] It will print: [QUOTE] asd class java.lang.String java.lang.String [/QUOTE] If it is a primitive type, I have tried … | |
Re: [QUOTE=Praveenhai;792104]Hi Friends, Any body please send me a complete java project on "Hospital Management System" or "Government Health care System". Please provide me in detail to [I]<<snipped email address>>[/I][/QUOTE] Also, even if we wanted to give you anything, there is no way anyone could write such a program because you … | |
Re: You might want to use the trim method as well. If the user enters: " 4 * 3 " Then the trim method will return this: "4 * 3" [CODE] String expr = " 4 * 3 "; expr = expr.trim(); [/CODE] | |
Re: [QUOTE=zhane88;790030] in any case if you can be of assistance. [/QUOTE] Of course we can be of assistance. Why else you think we are in this forum. The answer to your question is Yes! Now, mark this thread as solved and start a new one, with a real question and … | |
Re: [QUOTE=eng.hosam84;787655]Hi jhonnyboy . you can use "j2e_enterprise" software , which converts .jar file to .exe file . Download it and try it , actually it's perfect for me . hope my reply is helpful best regards eng.hosam84[/QUOTE] That is the worst advice ever. To encourage someone to go all this … | |
Re: First of all you need to tell us what of mistakes your are having. Is it compiler or it gives you wrong results and what kind. We might not be in front a computer with java installed. As for your error: The pop method doesn't return a char value but … | |
Re: The connection class should be declared outside the method connect() and take value inside it. In the way you have it, you create a new connection and when the connect method finishes, you can not use the conn variable since it is out of scope. Have a method the takes … | |
Re: [QUOTE=quuba;786890]char c = 'a'; String s = new String("" + c);[/QUOTE] It is easier to do this: [ICODE]String s = c + "";[/ICODE] But this is better: [ICODE]String s = String.valueOf(c);[/ICODE] I have checked and the latter is faster | |
Re: [QUOTE=britto;782572]i need to add tabs dynamically to the tabbedpane every tab will have jtextarea as component i tried this but everytime i click the button the first tab alone is changed.. tabbedpane=new JTabbedPane(); tabbedpane.addtab("new tab",null,textArea,null); [/QUOTE] That is because every time you press the button a [U]new[/U] JTabbedPane is created … | |
Re: Check this part of the code: [CODE] String line = null; Postfix b = new Postfix(line); while((line = reader.readLine()) != null) { line.trim(); //b.evaluate(); contents.append(line).append(System.getProperty("line.separator")); } [/CODE] You have the [ICODE]b.evaluate[/ICODE] in comments. But the point is that when you initialize the object you do it outside the while () … | |
Re: What you are saying doesn't make any sense, but you could create a separate class and call the constructor "tatat" inside that class's main method. But if are not familiar with constructors and using multiple classes from different files in one single main, then you should not been writing swing, … | |
Re: You need to call the read.nextLine() which returns a String, and use Strings to do the checks in the if Try searching the API for the Scanner because I don't quite remember the method | |
Re: First you need to learn how to read and write to files. There are plenty code examples here and tutorials. You will have a separate class for that with methods like: [CODE] public void write(SomeObject [] elements){ } public SomeObject read() { } [/CODE] You will have set,get methods for … | |
Re: compareTo should return an int if you want to override the one inherited by the Comparable interface. And it doesn't have to have specific value [CODE] public int compareTo(Koerper object) { } [/CODE] It should return a positive number if "this" object is "greater than" the argument "Koerper object" A … | |
Re: Try to take a look at this post: [URL="http://www.daniweb.com/forums/thread170371.html"]http://www.daniweb.com/forums/thread170371.html[/URL] | |
Re: [CODE] class Test { static void method1() { } static int method2(String s, double d) { return 1; } public static void main(String [] args) { method1(); method2("asd", 123); int i = method2("asd", 10.00); } } [/CODE] | |
Re: You need to explain what you are trying to accomplish and how because your code doesn't make any sense | |
Re: Have you even tried to read the advices posted here? [I]verruckt24[/I]'s example was quite simple, not to mention it was the solution. All you needed was to replace the comments with the code to read the input (1 line) - Read the input for the name - use the 'if' … | |
Re: Also when you write something outside the <% %> it is displayed the way you write (HTML style). So when you write this: <a href="viewdata.jsp?value1="+[I]sth[/I]+">"+ . . . It will not concat. It is not java and it is not a String to concat it. If you want to display … | |
Re: Does the code that you provided works? Because it seems OK. What errors do you get? Also, check the API for the String class. There should be a method for turning a String to upppercase | |
Re: [QUOTE=RohitSahni;782018]I will be starting working on perl and java soon.. Can anyone please help, form where to start so that i get the confidence of working on it and i can do hands on.[/QUOTE] At the top of this forum there is this easily found post: [URL="http://www.daniweb.com/forums/thread99132.html"]http://www.daniweb.com/forums/thread99132.html[/URL] | |
Re: I don't know if it is just me but I didn't understood anything from your program Could you please change the names of the variables to English? Thanks. | |
Re: [QUOTE=Ezzaral;781454]As each number is generated, check the current numbers array to make sure it does not already contain that number, if it does, just generate another.[/QUOTE] I would like to add another suggestion. If I understood correctly, you have a pot with 49 numbers and you want to randomly select … | |
Hi, as you can understand from the name, I am new in VB. So I have 2 questions regarding buttons: 1: I have an array of buttons created like this in the code: [CODE]Dim buttons(10) As System.Windows.Forms.Button[/CODE] I need whenever each one of these buttons is clicked to invoke the … | |
Re: Also the best way to do this is create a separate class Employee. This may compile and run but you should never do it like this: [CODE] public static void setEmpName(String empName) { System.out.println(empName); // EXAMPLE } [/CODE] The empName is the name of the employee when on the other … | |
Re: [QUOTE=nilima;779658]Would any one give idea About How to attach scanner through VB6[/QUOTE] May I suggest the VB forum | |
Re: And what are you trying to accomplish by doing this: [CODE] jl1=new JLabel("<html><center><font face=Maiandra GD size=5><u>Welcome to</u><p>School Management System</font></html>"); [/CODE] | |
Re: [QUOTE=mca_satbir;778921]"Hi this is Satbir Singh doing a job in a insitute as a trainner for c cpp java etc. But i have some appllication programs that is being difficule to solve for me in java . Would somebody plz help me for solving these problems that i m atteching with … | |
Re: I didn't notice any [I]private[/I] constructor in ByteBuffer and I don't there should be any since it is an abstract class. You are not supposed to initialize it | |
Re: When you say table you mean database table? If yes do an order by and read the data using ResultSet. Then check for duplicates | |
Re: From what I understood I presume that each line in the file will have many values (probably comma separated) that need to be put in each row of a 2D array. If this is the case then when you read the line use the split method of the String class: … | |
Re: [QUOTE=ankur_maniya;774362]hello. readers.... i am computer student last year... i want help from you...that i need some projecy defination which is ni java...please help ...[/QUOTE] If you search this forum you will find other posts were people ask for projects and some have project ideas | |
Re: [QUOTE=Alishaikh;770912]I have attached the file with the sorts. I have to show 2 sorts insertion, and selection sorts demonstration in bars. I should show the position of the bars after each run. How do i go on about doing that?[/QUOTE] What do you mean when you say: I have to … | |
Re: I have never used these objects before but I can tell you that you get the exception because you don't instantiate the 'msg' object: Blob msg; <-- it is null so when you write this: [B]msg[/B].setBytes(1,msgval) --> you get the exception | |
Re: The post at the top of this forum should get you started. Also I didn't see a question in your post. What do you expect us to do for you? | |
Re: First of all don't put a 'throws' at the main. Second of all the error is very easy to figure out. Check your notes on how to write and run a simple program. | |
Re: [CODE] boolean stop = false; while (!stop) { //code to be repeated //ask user if he/she wants to stop if yes stop = true; } [/CODE] | |
Re: Check this link on how to determine what kind of class is an instance: [URL="http://en.wikibooks.org/wiki/Java_Programming/Keywords/instanceof"]http://en.wikibooks.org/wiki/Java_Programming/Keywords/instanceof[/URL] | |
Re: Also it is best/common practice to have the attributes start with lower case: [CODE] private String achterNaam; public String getAchterNaam() { return achterNaam; } public void setAchterNaam(String achterNaam) { this.achterNaam = achterNaam; } [/CODE] Notice how the case changes from lower case to capital at the get/set method: [B]a[/B]chterNaam get[B]A[/B]chterNaam … | |
Re: [QUOTE=jeffreyjs;767826] And for my insert query, i got a error saying "Number of query values and destination fields are not the same.". What does this mean?[/QUOTE] Probably the number of values you are using are not the same with the number of columns you have in your query. Pay more … | |
Re: The driver you are using, seems to be correct. Have you tried this: Go to Project Properties > Java Build Path > Libraries. and add the mysql connectivity jar ? Also can you try to add this: printstacktrace, inside the catch: [CODE] public void initDB(String url) { try { Class.forName(driverName).newInstance(); … | |
Re: I got it. Here is the thing. The error you get is this: [QUOTE]Exception in thread "main" java.lang.StackOverflowError [/QUOTE] If I remember correctly it usually happens when you run out of memory due some "endless loop" thing. Please someone correct me if I am wrong. And here is the practical … | |
Re: [QUOTE=Simran1;767864]Hello, Please tell me in Java we don't have a multiple inheritance? so,in which function we use these inheritance. Thanks[/QUOTE] You say: > we don't have a multiple inheritance but then you ask:>in which function we use these inheritance The only thing I can say is that java doesn't have … | |
Re: [CODE] num5 = num1.subtract( num2 ); [/CODE] Also when you create your class and declare the private variables, you will need to implement the methods described. Example, with the above you will have a public method he take an argument a Complex object. Inside the method you will use the … | |
Re: [QUOTE=confusedGirl;764006]Hi all I have a [COLOR="Red"]miniproject [/COLOR]I need to submit tomorrow ,but I didn't finish it.. Please if any member have a time to check it for me,,tell me so I can send my whole work... I really will appreciate your help Please help me ....Iam so sad its 50% … |
The End.