1,963 Posted Topics

Member Avatar for NoviceChrilill

The answer is very simple. You declare 2 variables: "min" "secondMin" that hold the values of the "min" and "second min". So why don't you declare 2 [U]more[/U] values that will hold the indexes: "minIndex" "secondMinIndex" [CODE] int min;// declare variable int secondMin;// declare variable int minIndex;// declare variable int …

Member Avatar for unique72
0
591
Member Avatar for payal888
Member Avatar for 54uydf

This is a small summary of your code: [CODE] Term term = new Term(); while () { if (str exists) { // don't add } else { // add term } } [/CODE] The problem is that term is declared outside of the while. So you do new Term() once. …

Member Avatar for 54uydf
0
156
Member Avatar for manish250

What do you mean fetch the String. Since you already have the String, why do you need to fetch it? Also look at the String API: [URL="http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html"]http://download.oracle.com/javase/1.4.2/docs/api/java/lang/String.html[/URL] for methods that you might want to use.

Member Avatar for manish250
0
245
Member Avatar for jackcfj0129

Your Rational class seems ok. But you need to add private attributes to the class. When you call the constructor you need to assign the arguments. [CODE] class Rational{ private int numerator = 0; private int denominator = 1; // it cannot be zero! Rational(){ numerator = 0; } Rational(int …

Member Avatar for javaAddict
0
190
Member Avatar for javap
Member Avatar for Yangz_Seth

Use the String class. Check its API. Try to recognize if it is am or pm. If it is am then the result is the input, if you remove the last 2 characters: 2:00am - input 2:00 - output If it is pm, then just add 12 at the hour …

Member Avatar for Yangz_Seth
-1
124
Member Avatar for newcoder310

Under which directory did you put the .java files as well as the .class files. I mean that for example you should do something like this: Folder : src/test1 File: p1.java Folder : src/test2 File: p2.java ----------- Folder : [I]folder path[/I]/[B]comp[/B]/test1 File: p1.class Folder : [I]folder path[/I]/[B]comp[/B]/test2 File: p2.class CLASSPATH …

Member Avatar for JKP()
0
98
Member Avatar for fahadyousaf

What code do you use to insert other types in the DB? Post the code that you have so far. Do you use Statements, or PreparedStatements?

Member Avatar for javaAddict
0
79
Member Avatar for p.saiprasad

Buy a book, read a tutorial. How can anyone explain what you ask in a single post. What you ask is for someone to quote pages of books in a single post. Buy a book, read a tutorial. Write some code, compile it, deploy it. Use an IDE that does …

Member Avatar for javaAddict
0
73
Member Avatar for jaycastr

[QUOTE=ajst;1428856]whats the diffrence between having auto complete avaible to you and going to sun website and looking at all the avaible methods in that class? They both achieve the same thing but going to the website will just take a bit longer.[/QUOTE] You need to know where to look. Or …

Member Avatar for Akill10
1
460
Member Avatar for hao90

First of all NobodySpecial doesn't need to have the unplugDrain, changeBulb methods because it doesn't implement the interfaces. It is not wrong, but the methods are not mandatory. As far as your question. You can put the main method in whatever class you want. You can put it in the …

Member Avatar for hao90
0
113
Member Avatar for nikita.chandra

The format doesn't matter. It is used only for the presentation. As long as you have the date as a Date object there shouldn't be a problem. But if you have the date as a String, then you cannot insert it in the database if the column has Date type. …

Member Avatar for Shanti C
0
87
Member Avatar for harry.jhone

What exactly are you trying to accomplish? What do you want to build? Because from what I understand you want a software that will create your project for you. If you want to "develop application software and doing research regularly" then you should be learning the programming language on your …

Member Avatar for kvprajapati
0
92
Member Avatar for maria_megha
Member Avatar for manthra

[QUOTE=manthra;1426915]hi all, I'm new to jsp.can any one help me to set URL authentication ?i.e., the user should use the link only by login not by typing in the URL. can anyone plz???[/QUOTE] When the user logs in, put the username in the session. Example: [CODE] String username = request.getParameter("username"); …

Member Avatar for javaAddict
0
116
Member Avatar for daudiam

That is an interesting question. Have tried this: [CODE] class R2<E> { E a; E get() { return a; } void set(E a) { this.a=a; } void print() { System.out.println(a.getClass()); } public static void main(String aa[]) { R2 nn1=new R2<Integer>(); nn1.print(); } } [/CODE] Can you tell us if it …

Member Avatar for daudiam
0
205
Member Avatar for redflame777

[QUOTE=rohan_s;1424015]anyone please tell me how to find Krishnamurti number in java??[/QUOTE] Start a new thread and what is a Krishnamurti number? Do you know and you just want the java code? If not try searching the net for the definition of Krishnamurti number

Member Avatar for javaAddict
0
327
Member Avatar for khaled_jawaher

You posted the same exact question in a previous thread, which you got an answer. I don't know if it was the right one, but nevertheless, if you had problems you should have posted at the same thread. And [I]parry_kulk[/I], I believe that you also missed that in his jsp …

Member Avatar for khaled_jawaher
-1
1K
Member Avatar for khaled_jawaher

Take a look at this: [CODE] <%my.print()%;> [/CODE] The quote is in the wrong place. The idea is that you write java code inside the <% .. %> Inside a JSP page: [CODE] <% int a = 0; a = my.print(); %> <!-- This is not java. It is displayed …

Member Avatar for Ezzaral
0
178
Member Avatar for churva_churva

What errors do you get? What is wrong? You give no information as what is not working

Member Avatar for Akill10
0
135
Member Avatar for prem2
Member Avatar for prem2
0
689
Member Avatar for xxunknown321

[QUOTE=xxunknown321;1131984]The class should have as a field an ArrayList of T. Write a public method named add, which accepts a parameter of type T. When an argument is passed to the method, it is added to the ArrayList.[/QUOTE] Where in your code did you implement that requirement?

Member Avatar for ProgrammerAl
0
369
Member Avatar for Dean_Grobler

You want that other "Button 4" to have a different functionality or simply change its label. For changing label use the set methods of the JButton class API. For changing the button, you can try to look at the API of JButton, if it has a setVisible method. You can …

Member Avatar for javaAddict
0
117
Member Avatar for ellenski

This is java: [CODE] if ( !("pass2").equals("pass2") ) { } [/CODE] Try to run that code and see what happens. The "pass2" string will always be equal to "pass2" string. You write: "pass2".equals("pass2") . Those are fixed values and it is always true. And the ! will always make it …

Member Avatar for ellenski
0
7K
Member Avatar for spideyprasad

There aren't any default databases. You can use whatever you want with jsp, depending on the application.

Member Avatar for peter_budo
0
111
Member Avatar for theo23

You need to put the value attribute at the second option list of options like the first: [CODE] <select id="type" name="type"> <option>Please Choose</option> <option value="50">Single - 50£</option> <option value="60">Double - 60£</option> <option value="70">Luxury double - 70£</option> </select> [/CODE] Then submit the form to another page and take from the request …

Member Avatar for Shanti C
0
103
Member Avatar for Eric Cute

If you have that js variable, just display it using javascript. No java is involved. Assuming that you call a javascript function that calculates the resolution and you have that javascript variable calculated at the client. Then: [CODE] <script> function clacRes() { // when this function is called at client …

Member Avatar for Shanti C
0
29K
Member Avatar for BuhRock

The method str.charAt(i) that you are calling returns a char. Why don't you assign that call to a char variable and print that char. You can also call the toCharArray method: [CODE] String s = "1234"; char [] ch = s.toCharArray(); // Now print the elements of the ch array. …

Member Avatar for coil
0
178
Member Avatar for pradeeppatil110

Read this post: [URL="http://www.daniweb.com/forums/thread327418.html"]http://www.daniweb.com/forums/thread327418.html[/URL] And it is against the rules to post your mail and ask for people to send you the code there.

Member Avatar for masijade
0
201
Member Avatar for Dartz654

Can you be more specific in what way you will put them onto a website? Usually you something onto a website that has a GUI (Graphics user interface) How will the console application run on the net?

Member Avatar for Dhruv Gairola
0
191
Member Avatar for socheata

[QUOTE=socheata;1396861]Can u tell me the formula or the key word that make me understand than this?[/QUOTE] You posted 4 questions. Where are you having problems? There is no keyword for all of them. About the 1st, don't you know how to initialize variables? Ask specific questions. Study and then tell …

Member Avatar for apines
0
155
Member Avatar for ajst

That would depend on the page. There is no way of doing, if you don't know the code of the page. If you want to login then the url mustn't be one of the main page but the page that it submits to with arguments the username and password. Although …

Member Avatar for ajst
0
141
Member Avatar for RetNaRome

Look at your Songs constructor. The error is there. Also besides the error, why do you call the toString method in the constructor? It doesn't do anything.

Member Avatar for javaAddict
0
488
Member Avatar for plasticfood

Do you use in your code one of those methods: kb.nextInt() or kb.next() perhaps? The solution is very simple, but first let us know if the above is true and what other methods of the scanner class do you use.

Member Avatar for javaAddict
0
115
Member Avatar for serph09

One small advice. You do this in a lot of places in your program: [CODE] ArrayList<Double> studentScores = new ArrayList<Double>(); studentScores = gradeBook.get(indexOfStudent); [/CODE] It is not necessary. What you actually do is create a new ArrayList<Double>. A new instance of ArrayList<Double> in memory. And then you never use it. …

Member Avatar for javaAddict
0
165
Member Avatar for rony

[QUOTE=bolzjohn;1395570]develop a program to accept a sentence then display the word in reverse form. take note that a sentence should start w/ a capital letters and ends w/ a period. Further , count the total number of words and total number A's - Z's and a's - z's implement using …

Member Avatar for javaAddict
0
759
Member Avatar for blknmld69

The for loop should start at i=0. Print the all elements of the array. You call the dump twice with 2 different calls of the split method. Print the data of the array and then decide which split call suits you better [U]and[/U] which element of the array holds the …

Member Avatar for javaAddict
0
107
Member Avatar for koushikroy1989

[QUOTE=kalpanakovuru;1395632]Hi Koushik, Below code is to set the session [B]//This code goes in server side (servlet).[/B] [code]HttpSession session = request.getSession(true); //create a session object session.setAttribute("key", "value"); [/code] [B]//This code goes in client side (jsp).[/B] [code]// this will return the value in session String value=(String) session.getAttribute("key"); [/code] After getting the session …

Member Avatar for javaAddict
0
142
Member Avatar for Codeslinger
Member Avatar for usiyalla

[QUOTE=martin5211;1394060]Have you tried [ICODE]if(saw == "")[/ICODE]?[/QUOTE] [I]martin5211[/I] please, If you don't know what you are saying don't post wrong advices. Be sure about what you post and test it before you post it. Don't use ==. Never use ==. The problem is that if you don't enter anything at the …

Member Avatar for usiyalla
0
2K
Member Avatar for hiddenman91

Delete everything you have written. Start by studying html, because your tags are wrong. Then put the "database" code in a separate method that returns a list with the values from the DB. Better create a class with attributes ID and NAME and return a list of that object. In …

Member Avatar for hiddenman91
0
287
Member Avatar for rincethomas33

[QUOTE=rincethomas33;1394569]i want to create a menu. if i press the menuitem,then a certain action will occure.. and so on... give the details please...[/QUOTE] What you ask has been done so many times in this forum. Do some little searching. Also you should give it a try. It is not that …

Member Avatar for Dhruv Gairola
0
128
Member Avatar for Dean_Grobler

The error says: "non-static variable MainList" I assume that MainList is non static, so in order to access you need to have an instance of the class MainScreen

Member Avatar for JamesCherrill
0
128
Member Avatar for XxPKMNxX
Member Avatar for StarTrekCafe
Member Avatar for nitins60

That is because 23837472 is not a long it is an int. This is a long: 23837472L Try this: [CODE] long l = testApp(23837472L); [/CODE] When you use the 45638, that int number is turned into a long. The reason why you need to add the 'L' is because if …

Member Avatar for nitins60
0
10K
Member Avatar for subrat_p

Of course you get null because the query doesn't return anything! Try to print the argument of the query or better yet the query itself: [CODE] System.out.println("SELECT * FROM student where sno='"+stname+"'"); [/CODE] You will also need to close the connection, the statement and the resultset before proceeding. I also …

Member Avatar for javaAddict
0
324
Member Avatar for subrat_p

It seems that your problem is with reading from the database. That has nothing to do with gui. All you need is to read the data that you want and then use them in any way you want (pass it as parameter at the setText method). Search for tutorials and …

Member Avatar for javaAddict
0
67
Member Avatar for manish250

I don't know if that is the problem or you simply forgot to post it, but you haven't closed the <a> tag. You didn't put the </a> [CODE] <td align=center> <a href="successLogs.jsp?strHour=<%=strDate+strHour%>&strcli=<%=strcli%>"> <%=totSuccCount%> </a> </td> [/CODE] And you don't need the <u> tags in order to have it underlined. Also …

Member Avatar for manish250
0
265

The End.