1,963 Posted Topics

Member Avatar for ezkonekgal

First you need to define what kind of structure to use in order to represent your tree. An array for example. Then you write code that inserts and reads the data, at and from the right place

Member Avatar for verruckt24
0
379
Member Avatar for charlie81

It is : [ICODE]main(String [] args)[/ICODE] Also I think that you have the formula for surface_area wrong

Member Avatar for javaAddict
0
91
Member Avatar for sumanbabu

[QUOTE=sumanbabu;818855]any small program using stringlist[/QUOTE] [CODE] System.out.println("This is a stringlist"); [/CODE] [URL="http://www.daniweb.com/forums/announcement9-2.html"]Read this[/URL]

Member Avatar for javaAddict
0
41
Member Avatar for tazjaime

[QUOTE=JamesCherrill;818045]I just gave him the quickest way to get the output he was looking for - which seems to be what he wanted, judging by his reply.[/QUOTE] I will have to agree with [I]verruckt24[/I]. When you said to change the double to int (or long, I don't remember) your [U]explanation[/U] …

Member Avatar for JamesCherrill
0
202
Member Avatar for dipsn
Member Avatar for javaAddict
0
69
Member Avatar for MarMcD

Apparently you are tying to use methods that don't exist. You don't just call methods just because you like it. You need yo declare them first

Member Avatar for MarMcD
0
160
Member Avatar for karthikRaju

[QUOTE=chandanapiit;816131]hi any one online[/QUOTE] Hi, anybody home [I]chandanapiit[/I]?

Member Avatar for javaAddict
0
171
Member Avatar for rayda

You initialize the array, but you don't put values in it. So by default the values that it has are zero because the int variables are initialized to zero. This might not seem serious but if the array was String it would null. So next time, you don't just create …

Member Avatar for javaAddict
0
99
Member Avatar for IMtheBESTatJAVA

Well assuming that this is not homework, I think that it is a good idea. I know that most of us, including stephen84s, can do this in 30 seconds, but others might learn from it and newbies may test their skill. Of course the OP could also add the link …

Member Avatar for verruckt24
0
167
Member Avatar for lovely_aly

You wrote the code. Does it compile? If it does, is it so difficult to run it?

Member Avatar for javaAddict
0
152
Member Avatar for gabec94

What kind of error, and didn't you notice the methods: subString, indexOf, or charAt. at the String API?

Member Avatar for Taniotoshi
0
564
Member Avatar for radar2009

[QUOTE=budz;813882]who said i wud bs last assignment just want it out the way enit[/QUOTE] What you said makes no sense. Please use proper English

Member Avatar for stultuske
0
192
Member Avatar for onyxmethod123

Also you don't need this in your class: [CODE] private Circle circles; [/CODE] In your class you define the ArrayList of circles, so you don't need that circle object. Everything will be put in that list and you will have methods that add and read or print from that list …

Member Avatar for stultuske
0
66
Member Avatar for nedsnurb

The method compareGuess should be inside a for-loop not a for-loop inside the method. The way you have you iterate, but the value "userRandom" doesn't change, so the same if is executed all the time. You need to have the method inside the loop and ask the user each time …

Member Avatar for javaAddict
0
107
Member Avatar for localp

The line read is in the [ICODE]strLine[/ICODE] variable. Since you have already defined your array, you can simply put that value inside the array. Of course within each while-loop run you will need to increase the index of the array so you will put the next line to the next …

Member Avatar for stephen84s
0
98
Member Avatar for hinasaeedali

[QUOTE=nishantdaniweb;811321]Sorry hinasaeedali, I can't help you. Some time you are asking you are facing problem while making shopingCart and now you are asking how to get parameter. You didn't clearly mention your problem. As i understood you want to know how to get request parameter when you click on submit …

Member Avatar for nishantdaniweb
0
118
Member Avatar for blossoms

This link is at the top of the JSP forum. Instead of insert it does a select, but it show how to pass data from the jsp to the servlet, run the query and then return back to the jsp. So all you have to do is change the query …

Member Avatar for javaAddict
0
66
Member Avatar for cproud21

You were told to use get, set methods in your class and you used only a set method that changes all the variables of your class. In class: policeOfficer for example you have only a set method which is not what was suggested. Plus the attributes are declared private meaning …

Member Avatar for javaAddict
0
254
Member Avatar for javaman2
Member Avatar for Narayan15

First of all in java is very simple. Classes to use: Date, SimpleDateFormat, Thread. And no we will not write the code. As instructed to other forum you posted ([URL="http://www.daniweb.com/forums/thread176644.html"]http://www.daniweb.com/forums/thread176644.html[/URL]), first try it yourself and we will see what we can do. Also if you want this done on a …

Member Avatar for stultuske
-1
220
Member Avatar for Johannady2

Not to mention that you failed to explain what is your problem. You just posted some piece of code without saying anything. Also you were the one that hijacked a 11 month old thread, whithout explaining anything and confusing everybody

Member Avatar for verruckt24
0
118
Member Avatar for aodpreacher

[QUOTE=aodpreacher;804472]i know that you cant use Arrays.sort since it will only compare the one City array object[/QUOTE] What do you mean by that? Aren't you going to save all the City objects into one array? [CODE] City [] cities = new City[10]; Arrays.sort(cities); [/CODE] Maybe I am missing something. Can …

Member Avatar for BestJewSinceJC
0
137
Member Avatar for youngstorm

[QUOTE=youngstorm;796265]if the number was found in the array, I want to return that number[/QUOTE] Yes but what are you using to search the array? If you are using the number and want to see if it is there then you already have the number. If your method takes as argument …

Member Avatar for youngstorm
0
126
Member Avatar for jpp10

Well the error is very simple. You should have figured it out form the compile message. Understanding compile messages is very important if you want to learn programming. [CODE] import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; [/CODE] You import those classes. You must also import the StringTokenizer [CODE] import java.util.StringTokenizer [/CODE] …

Member Avatar for jpp10
0
182
Member Avatar for nimbus3000

[CODE] CE emp1 = new CE("Martin", "Sheen", "420", 0.2, 100000); public CE(String fName, String lName, String secu, float commRate, float grossSales) [/CODE] When you write: [U]0.2[/U] java interprets it as a double. But your constructor accepts a float. So you need to "tell" java to treat [U]0.2[/U] as a float …

Member Avatar for nimbus3000
0
102
Member Avatar for soniarad

3 suggestions: Try printing the query and then run it at your database to see if it actually updates. Maybe the WHERE clause is false Maybe I am wrong, but try first to close the statement and the connection [U]and[/U] redirect And finally: THIS IS THE MOST IMPORTANT: Delete everything …

Member Avatar for ~s.o.s~
0
143
Member Avatar for MarMcD

I think that because you do something like this: [CODE] String musicCd[] = { "Fergie", "Celine Dion","Kelly Clarkson", "Chris Daughtry"}; public void musicCd() { } [/CODE] Maybe because you are using the same name. I am not sure but you might want to test it

Member Avatar for javaAddict
0
232
Member Avatar for zangster421k

And to complete [I]rapture[/I]'s suggestion, try writing and TESTING small pieces of. Break down he assignment into small pieces of code and test them individually. You have written lots of stuff and you didn't explain what is the problem. I have noticed that you read and write from files. >Create …

Member Avatar for javaAddict
0
189
Member Avatar for marjan_m

The "mainMenu" should be the id of the table. Since you are using this: [ICODE]document.getElementById("mainMenu") [/ICODE] It is quite obvious when you say "getElement[B]ById[/B]" that the argument should be the id of the element you are trying to take.

Member Avatar for marjan_m
0
171
Member Avatar for tiborv

Try this, although I am not sure since I have never used the "include" tag like this: [icode]<%@ include file="<%= somepage%>" %>[/icode]

Member Avatar for tiborv
0
82
Member Avatar for de boer

[QUOTE=masijade;801982]Of course, but we need more info (as my first reply, sarcastically, implied). Post all error/compiler messages, post your code, and post what the program produces and what it is suppossed to produce.[/QUOTE] As [I]masijade[/I] said, you failed to tell us what errors do you get. You are not going …

Member Avatar for javaAddict
0
819
Member Avatar for vamsi.g

You can use the method: [ICODE]Integer.parseInt[/ICODE] [CODE] String s = "12"; try { int i = Integer.parseInt(s); //do calculations here } catch (NumberFormatException nfe) { } [/CODE] If s is not an integer then the method will throw an exception. So call the method I told you and if it …

Member Avatar for ~s.o.s~
0
2K
Member Avatar for navinlearns

If you search the internet (Yahoo) for: [QUOTE] java API BufferedReader [/QUOTE] you will find the API of BufferedReader with all possible constructors. Also what do you mean read from a variable. If you want a variable to be the input of the constructor, that variable will have to be …

Member Avatar for ~s.o.s~
0
77
Member Avatar for tksrules

First of all you don't say which tabs you couldn't do. Yes you did the Pool tab on your own, but which tabs you did and work and which don't work? So I would suggest to post the code of the tab that you are having problem with. ONE tab …

Member Avatar for rapture
-1
116
Member Avatar for eclipse3.4ide

First of all the name of the select is: "selectPrimaryKey", so you will need something like this: [CODE] String nval=request.getParameter("selectPrimaryKey"); [/CODE] Also the select needs 1 minor change: [CODE] ............ <select name="selectPrimaryKey"> <option>SelectValue</option> <% for (int i = 0; i < Nheadlist.size(); i++) { %> <Option value="<%= Nheadlist.get(i)%>" > <%= …

Member Avatar for javaAddict
0
88
Member Avatar for Laidler
Member Avatar for rlaknar

Try changing this line: [CODE] rs1=stmt.executeQuery("insert into userinformation(username,password,dateofreg) values(username,password,dateofreg)"); [/CODE] To this: [CODE] rs1=stmt.executeQuery("insert into userinformation(username,password,dateofreg) values ('"+username+"','"+password+"','"+dateofreg+"')"); [/CODE] Also the exception tells you at which lines you got the error. It would be better if you point out to us which lines are that, because we cannot just count …

Member Avatar for rlaknar
0
184
Member Avatar for k2k

You have 2 while loops one inside the other that do exactly the same thing in the opposite. There are much better codes than that: [CODE] boolean done = false; while (!done) { // and now k2k's code enter input if (answer.equals("yes")) { do whatever calculations you want to do …

Member Avatar for ddanbe
0
721
Member Avatar for Alishaikh

From a quick look at your code you have this: [CODE] case 2: mart.print(); // Call break to avoid falling through to the default case. break; [/CODE] It is suppose to print the shopping cart. Are you having problems with that?

Member Avatar for Alishaikh
0
116
Member Avatar for Y2K_MASTER

[QUOTE=Y2K_MASTER;793557]I want the program to take 2 user inputted numbers and then carry out the calculations I have added at the bottom. eng.M4AH, When I switch the order like you have stated, the BlueJ doesn't run the program. I think you're on to something though[/QUOTE] [I]eng.M4AH[/I] is [B]correct[/B], but yes …

Member Avatar for Y2K_MASTER
0
144
Member Avatar for k88joshi

Check the API for the String class. It has a replace method. Also if you search this forum you will find examples on how to read and writes files. So read the file line by line. For each line use the replace method and save the result (the modified line) …

Member Avatar for k88joshi
0
104
Member Avatar for etc123

Because when you do this: [CODE] String [][] array2D = new String[5][]; [/CODE] You don't create a 2-D array, but an [B]1-D[/B] array that takes as 'elements' arrays. So you can do this: [CODE] array2D[0] = new String[2]; array2D[1] = new String[10]; .... [/CODE] and access like: [CODE] array2D[0][0]; array2D[0][1]; …

Member Avatar for stultuske
0
101
Member Avatar for k2k

Check the API for [URL="http://java.sun.com/javase/6/docs/api/java/util/ArrayList.html"]ArrayList[/URL]. It is the most commonly used [CODE] ArrayList list = new ArrayList(); list.add("asd"); list.add("fgh"); list.add("erty"); for (int i=0;i<list.size();i++) { String s = (String)list.get(i); System.out.println(s); } [/CODE] Or if you use generics (after java 1.5) [CODE] ArrayList<String> list = new ArrayList<String>(); //here you define what kind …

Member Avatar for javaAddict
0
115
Member Avatar for jdbarry

[CODE] BufferedWriter writer = new BufferedWriter(new FileWriter("fileName")); writer.write("write here"); writer.newLine(); [/CODE] Check the API for the BufferedWriter in case I have some errors in the syntax

Member Avatar for javaAddict
0
202
Member Avatar for shirish_kal

[QUOTE=stephen84s;779544]Not until you show us what effort or analysis you made in tracing that error. And as I said before do not just vomit back what your system throws back at you, show us some analysis, some effort from your side. **Also my instinct suggests this is not your code …

Member Avatar for prashant yadu
-1
268
Member Avatar for ashwathy

[QUOTE=kaptan SINGH;714468]i'm want to source code related to the project online airline ticket reservation in jsp 7 help to devlop in project[/QUOTE] I guess your skills are limited only to writing and not to reading, because if you had read the previous posts you wouldn't have made such question thread-jacker …

Member Avatar for ~s.o.s~
-1
155
Member Avatar for mona515

[QUOTE=seemant gupta;793882]please marked it solved if it has solved your problem[/QUOTE] First of all this is not a contest of who will get the most solved threads. I say this because: The "solution" given is not the best that could be provided and it is very difficult to understand what …

Member Avatar for javaAddict
0
75
Member Avatar for vedmack

Where do want it to be displayed because I don't think that it can be done. I would suggest you look at the API for PrintStream Because the System.out is type of PrintStream. This will behave exactly like the System.out.println [CODE] PrintStream print = new PrintStream(System.out); print.println("aaaaa"); [/CODE]

Member Avatar for vedmack
0
5K
Member Avatar for cicigirl04

You need to count how many elements are inserted and when you reach 10 exit. If I understood correctly you will need this: [CODE] int count = 0; do { System.out.print("Enter 1 for F to C, 2 for C to F, and 3 to quit"); choice = input.nextInt(); if (choice …

Member Avatar for arseniew
0
493
Member Avatar for DJMASSIAH017

What errors do you get and at which lines. Post the errors you get. Also if it runs what results do you get what you were expecting? Also the tab character is this: \t System.out.println("aaa\tbbbbb") and for new line: \n System.out.println("aaa\nbbbbb") Try running the above just for testing

Member Avatar for javaAddict
0
3K

The End.