1,963 Posted Topics

Member Avatar for clickranju

[QUOTE=clickranju;681951]Thanks ..i thought JSP is a server side scripting language using in web development..Am i right..? My question is which will be more efficient and useful for this project...[/QUOTE] Actually .jsp files have html "code" inside them (the proper term is html tags). But with JSPs you can add java …

Member Avatar for clickranju
0
146
Member Avatar for letlet_pogs

As you say in one of you other posts, if you are new and don't know how to make code, start by writing simpler codes

Member Avatar for peter_budo
0
120
Member Avatar for shelly2373

Try to write a class that saves the objects you create (namely the Inventory instance that has all the DVDs and movies) to a file. Yo could use the classes: FileInputStream ObjectInputStream FileOutputStream ObjectOutputStream You objects must also implement the Serializable interface to do that

Member Avatar for deush
0
449
Member Avatar for ravikiran032

From a tutorial I have: For example, to create a cookie named userID with a value a1234, you would use the following. Cookie c = new Cookie("userID", "a1234"); If you create a cookie and send it to the browser, by default it is a session-level cookie: a cookie that is …

Member Avatar for nsisupalan
0
288
Member Avatar for joshmo

And the getPages(), getTitle(), methods are not declared in the Book class. That is why you get error. They are defined in the Chapter class so you should do: [CODE] public void printContents() { System.out.println("Contents:"); System.out.println("1." +first.getTitle()"........." +first.getPages()); System.out.println(""); System.out.println("2." +second.getTitle()"...........:" +second.getPages()"\n"); System.out.println(""); System.out.println("3."+third.getTitle()"...........:" +third.getPages()"\n"); System.out.println(""); } [/CODE]

Member Avatar for joshmo
0
219
Member Avatar for kevinpeterson22

Create in a separate class methods for connecting writing and reading to the database. Then replace the code where you write to the file with the methods from the class

Member Avatar for jwenting
0
296
Member Avatar for Minimandz

Probably because the file does not exist. And you could use BufferedReader for reading from file.

Member Avatar for Minimandz
0
136
Member Avatar for ravikiran032

You will instantiate a class the extends from InputStream. The class will have implementation of the abstract methods.

Member Avatar for Ezzaral
0
131
Member Avatar for joshmo
Member Avatar for ceyesuma

[CODE] for (int i=0;i<personList.size();i++) { String s = personList.get(i); } [/CODE]

Member Avatar for ceyesuma
0
75
Member Avatar for rs_java
Member Avatar for dianac10
Member Avatar for dianac10

If what you said made sense, the answer is NO. Html is a tagged based "language" used to create web pages. Javascript (has nothing to do with java) is executed in your browser (to be exact is executed at the client but I don't know how else to explain it …

Member Avatar for dianac10
0
110
Member Avatar for sarath.koiloth

You can use the Locale to parse a certain Date object: [URL="http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html"]SimpleDateFormat.html[/URL] And use the constructor with the Locale as argument. [CODE]SimpleDateFormat(/*String pattern*/ "dd/MM/yyyy", Locale.ENGLISH) [/CODE] But I don't think that what you are asking is possible.

Member Avatar for sarath.koiloth
0
298
Member Avatar for ocreds

[CODE] double a = Math.exp(b); //e^b double c = Math.pow(a,b); //a^b [/CODE] Go to this link: [URL="http://java.sun.com/javase/6/docs/api/java/lang/Math.html"]Math[/URL]

Member Avatar for javaAddict
0
149
Member Avatar for micheal_lobster

I trust that you already have created the class: Staff. It should be like what sciwizeh has suggested. This is an example on how to read from the keyboard: [CODE] Staff [] staff = Staff[12] //this is an ARRAY. It is not null, but these are: staff[0], staff[1], ... BufferedReader …

Member Avatar for micheal_lobster
0
125
Member Avatar for jOhN_pRattZ

[QUOTE=jOhN_pRattZ;674319]hello im john rico a com sci student could anyone help me to make a program that has three equation and three unknown pls.[/QUOTE] You can either use Gauss as sciwizeh has suggested, but if don't know the algorithm you can do it the old fashion way, by solving this …

Member Avatar for Phaelax
0
185
Member Avatar for algorion

I would suggest to look at this class: [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/util/logging/Logger.html"]Logger[/URL] And search tutorials or examples, since you are interesting in log files

Member Avatar for javaAddict
0
158
Member Avatar for ceyesuma
Re: List

There is a null personList of type List, but you declare that the null personList List will have ONLY elements of type Person. The personList maybe null, it is type List but you put "things" in the List. And you declare that when you are going to put things in …

Member Avatar for ceyesuma
0
101
Member Avatar for liam_page1

You did a whole year of programming and no one taught you the simple algorithm for looping and finding the max number?

Member Avatar for stultuske
0
100
Member Avatar for rcoleman

What do you want getInvoice() to return? Are you sure you have posted all the code of the Invoice class? It seems to me that the Invoice variable inside getInvoice() doesn't have a value, but I will need the rest of the code to be sure

Member Avatar for rcoleman
0
253
Member Avatar for tactfulsaint

The code will be the same. It doesn't matter for what you are going to use it. I will post the code soon, after I finish some other issues I have.

Member Avatar for ~s.o.s~
0
569
Member Avatar for Naween

You haven't done this: btnref.addActionListener(this); And why do you do this: txtamt1.setText(null) instead of this: txtamt1.setText( "" )

Member Avatar for Ezzaral
-1
86
Member Avatar for hny_lyn

[CODE] package testpackage; /** * * @author stamatios.bardanis */ public class Person { private String name=null; public Person() { name=""; } public Person(String na) { name = na; } public String getName() { return name; } public void setName(String na) { name = na; } public String toString() { return …

Member Avatar for javaAddict
0
196
Member Avatar for ocreds

Fist of all, as a concept do you know what stack is? Do you know what this calculates to: + a b? Stack is a structure where you put items in it one after the other and when you want to remove one you take the last one entered (LIFO). …

Member Avatar for javaAddict
0
219
Member Avatar for dav555

Read the file line by line. When the line you have read is equals to: START_IMAGE, then the next lines will be the image. Then when the line read becomes equals to: END_IMAGE then exit the while loop that you had for reading the file: [CODE] String line = readLine(); …

Member Avatar for dav555
0
106
Member Avatar for shaynicb25

First of all, this: int[] letterCount = new int[26] ; does not throw an exception. Second: Let me guess your program does not compile. This is why: [CODE] try { int[] letterCount = new int[26]; } catch (ArrayIndexOutOfBoundsException e) { System.err.println("Caught ArrayIndexOutOfBoundsException: "+ e.getMessage()); e.printStackTrace(); } [/CODE] You declare letterCount …

Member Avatar for javaAddict
0
444
Member Avatar for HLA91

The int numberValue = Integer.parseInt(number) ; does not throw a IOException. You are right to use it in the catch since readLine() does throw the IOException, but the parseInt() throws a NumberFormatException: [CODE=JAVA] /** * @(#)GetUserInput.java * * * @author * @version 1.00 2008/8/2 */ import java.io.*; public class GetUserInput …

Member Avatar for javaAddict
0
157
Member Avatar for Naween

Since they are interfaces, you can implement more than 1: [CODE] public class MyFrame extends JFrame implements ActionListener, ItemListener { } [/CODE] Don't forget to add the methods that these interfaces have. Also to add the "listeners" to the components you are interested (buttons)

Member Avatar for Naween
0
77
Member Avatar for zulaila

[QUOTE=dhanasekar1986;665041]i have to do mini project on online share trading system... if have coding mail me....[/QUOTE] Are serious? Read jwenting's previous post. And even if you started a new thread, why should we send you our code?

Member Avatar for jwenting
0
125
Member Avatar for raj1108

So not only you want project titles, (an issue that is discussed many times in this forum) but also you want the solution. If I ask for a date with Pamela Anderson, you think that anyone will reply? :icon_smile:

Member Avatar for jwenting
0
144
Member Avatar for vish_1x1

It is not very efficient reading from ResultSet while generating the html. Better to have separate class that returns as an array of objects the data you want and then use that data to generate the page. And the class will be responsible of handling the opening and closing of …

Member Avatar for vish_1x1
0
118
Member Avatar for ricss_madara

Probably he wants a menu with a while loop where the user can enter from the keyboard a number and a date several times

Member Avatar for sciwizeh
0
249
Member Avatar for ricss_madara

[QUOTE=ricss_madara;661913]main manu 1 for Addition 2 for Subtraction 3 for Multiplication 4 for Division 5 for Choice not in list[/QUOTE] You have posted the same question to a different thread: [URL="http://www.daniweb.com/forums/post661955.html#post661955"]http://www.daniweb.com/forums/post661955.html#post661955[/URL] When you were asked from sciwizeh to provide more information, why didn't reply, but started a new one? Any …

Member Avatar for javaAddict
0
103
Member Avatar for hny_lyn

Do you know which part of the code needs to be replaced with JOptionPane? If you don't that probably means that you didn't write it. Tell us what you don't understand and we will help, but no one is going to email you the solution

Member Avatar for javaAddict
0
186
Member Avatar for samuel_1991

Do you know that the array will already have the values sorted? From what I see: double[] priceArray = { 21.00, 17.00, 12.00, 10.00, 4.90, 4.90, 1.80, 1.80 } ; The array is already sorted, so you just need to take the 2 last values. If this is not the …

Member Avatar for samuel_1991
0
136
Member Avatar for ymf

No you need to have a finally because even if an exception occurs you will still need to close the PrintWriter. The error happens because you declare PrintWriter inside try {....} and in the finally it is out of scope, it cannot be used outside try because this is where …

Member Avatar for ymf
0
122
Member Avatar for shwetha_cs26

At the line where you get the NullPointerException you are probably trying to use an object that is null and instantiated. See what the message says and you will find which object is that. Then instantiated correctly based on what is the object

Member Avatar for VernonDozier
0
171
Member Avatar for bloody_ninja

Math.random() The above returns a random number between 0 and 1 [QUOTE]a pseudorandom double greater than or equal to 0.0 and less than 1.0.[/QUOTE] [URL="http://java.sun.com/javase/6/docs/api/java/lang/Math.html#random()"]Math.random()[/URL]

Member Avatar for Alex Edwards
0
641
Member Avatar for ricss_madara

[QUOTE=ricss_madara;656772]investment duration interest rates offered Less then 3 months 5% 3month-11 months 5.5% 1 year-23 months 7.6% 2 years and above 7.9% Note: Interest = Total investment *Interest rates *Duration Q: How to write a java application to compute the total accumulated investment after the investment periods?[/QUOTE] The inputs of …

Member Avatar for jasimp
0
143
Member Avatar for jimbobjoe
Member Avatar for zoooz_20

If you have solved a problem and you run it and it works then don't post it. Post only those that you are having problems with.

Member Avatar for javaAddict
0
274
Member Avatar for ricss_madara

Two arrays length 10. In one you will put the squares and at the other the cubes. Use a for loop from 0 to 10. Calculate inside the loop theresults and put them in the array: [CODE] square[i] = i*i; cube[i] = i*i*i; [/CODE]

Member Avatar for bloody_ninja
0
999
Member Avatar for d4n0wnz
Member Avatar for mrityunjay22

[QUOTE=bmbvm5;553492]hello, I am beginner in java . I have very difficult assignment so I need some one guide and help me. can you help me . with best regards[/QUOTE] Then create a new post and state what you cannot understand and what is your problem

Member Avatar for tuphng
0
966
Member Avatar for tactfulsaint

In a separate class write a method that takes two arguments (username, password). That method should query the database using these two arguments, in order to check if there is such record. If the above combination (username, password) exists then the method should return true, otherwise false. Then create a …

Member Avatar for tactfulsaint
0
91
Member Avatar for twgood

[QUOTE]Create a method to calculate the value of the entire inventory.[/QUOTE] It is the classic algorithm: sum += sum+VALUE[i]. Write a method the takes as argument the array of DVDs and inside a for loop calculate the sum. As VALUE[i] you should use: dvd[i].value() [QUOTE]Create another method to sort the …

Member Avatar for javaAddict
0
88
Member Avatar for kishor_agrawal
Member Avatar for shaynicb25

And what is your question? From a first look it seams that the program works OK. Are you having any problems or the results you receive are not correct? I would suggest adding some checks for the inputs: [CODE] if (args.length<10) { System.out.println("Not enough arguments"); System.exit(1); } [/CODE] or code …

Member Avatar for javaAddict
0
114
Member Avatar for LevelSix

I think there is something called: "instance of". I don't remember by heart how to use so might want to search it, but I do know that it works almost like this: [CODE] Rectangle r = new Rectangle(); if ( r instance of Rectangle ) { } [/CODE] But you'd …

Member Avatar for LevelSix
0
131

The End.