Help coderanch get a
new server
by contributing to the fundraiser

Ruchi Kolla

Greenhorn
+ Follow
since Jan 24, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ruchi Kolla

" doesn't have any problem if you store in database. The only problem is with single quote '. If you are preparing a SQL query with the form submission values you need to escape the single quote by adding another single quote.
If you have option of PreparedStatement you need not worry about escaping these quotes. PreparedStatement will automatically takes care of special characters.
For escaping the single quotes the bestway is to write small function and append another single quote.
21 years ago
In your salary.jsp page remove <jsp:setproperty> tag and try it again.
21 years ago
JSP
SingleThreadModel doesn't gaurentee the single instance by definition itself. If you want to have only single instance don't use SingleThreadModel.
If you don't use Single Thread Model by default the server creates one single instance and makes all requests to that servlet as multiple threads.
If you want to use SingleThreadModel for synchronization purpose use synchronized code inside your servlet rather than using SinglThreadModel.
Hope this help you.
21 years ago
How do you transfer call to JSP from servlet? Is it a redirect or forward? Is there any special webserver exists infront of Websphere?
21 years ago

Originally posted by Junilu Lacar:

Ruchi,
You can check your answers against this authoritative source: http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#229308



Hi Junilu Lacar
Thanks for correcting me. I have a book of RHE(which is First edition-1999 give by some one to me ...i mean not the latest one of the authors).In that book on Page 6 they have kept true,null etc in the table of java keyword..so I was sure while answering the question.
but thanks for correcting me. I am wondering but how can authors write it this way...anyway I am happy that I got the corrected.
This is the advantage of this group.
Thanks again.

Originally posted by Valentin Crettaz:
Ruchi, if you ever have to guess in an exam, that means you are not ready (No hard feelings)


No what I mean if already it is mentioned like which of the 3 answers are correct...we can choose the 3 answers and we are 100% sure. We don't need to think agin at all. I agree, guess work won't help but I was not knowing that it will be mentioned in the question itself that so many options for the given question are going to the answer

Originally posted by Manfred Leonhardt:
HI Christian,
Yes they do. Example:
Which 3 of the following answers is true.
Which 2 code snippets will result in ...
Regards,
Manfred.


oh is it so...then we don't need to do guess work. That means if there are multiple answers , that number will be mentioned and it will be chechboxes and for single answer question it will be radio buttons.
Please correct me if I understood wrong.

Originally posted by Abraham Lee:
Here is the code:
class X {
public static void main(String[] args) {
try {
int i = (-1 >> 65535) + 1;
int j = 5/i;
System.out.println("Something");
}
catch (Exception e) { System.exit(0);
}
finally { System.out.println("Finally");}
}
}
When I have run this code nothing is displayed.
I have thought that finally method is called no mather do we have or haven't Exception.
Can someone clarify this.
Thanks


Now see if you comment the System.exit(0),


You will get catch statement as well as finally part is also executed.

Originally posted by Rob Ross:
Hey that's a really good question Mark! I would guess it's public, but I don't know for sure!

Rob


For sure its public. You can create instance of the class from any package.

Cud somebody clarify my understanding on java keywords by answering these questions. I seem to be lost inbetween the terms "keyword" and "reserved word" .
1 Which of the following are java keywords ?
a> short
b> goto
c> null
d> true
2. Which are java reserved words ?
a> short
b> goto
c> null
d> true

Thanks in advance!



For Q1: a,b,c,d
For Q2:b

swapna:
Are you sure about removing final still working?
I tried this code too, it works if I remove final modifier. final modifier sure plays a rule in this error, since you cannot assign twice to a
final variable, while you can change a non-final
variable's value more than once.
victor


yes I agree with victor. It works after final is removed

In the second instantiation, however
SuperClass s = new SubClass( "The" );
we're creating a SubClass object of SuperClass type which does have the correct constructor
Also I want to be sure that if a subclass extends a superclass, but the subclass only has the no args default constructor, as in this example, will the compiler ALWAYS try to invoke the superclass constructor?


Here is the code it will work

The output is:
Inside SuperClass without args
Inside SubClass with args
When the SuperClass has any argumented constructor, it is necessary that we should define no argument construtor for it. the compiler always try to invoke the superclass constructor with no args unless specified like:

In this case it will call the argumented Constructor of SuperClass and we don't need no argument constructor in SuperClass.
But if we are not calling argumented constructor of SuperClass, the compiler will try to invoke no argumented constructor of SuperClass even in argumented constructor of SubClass.
What I understand that Gridbaglayout is not going to be asked in the test. Please correct me if I am wrong???

Hi
Why following program prints 10 and 1.0. Any Idea??


No, it is printing 10,10.0. Please check it again...