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
![]()
Originally posted by Valentin Crettaz:
Ruchi, if you ever have to guess in an exam, that means you are not ready(No hard feelings)
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.
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
Originally posted by Rob Ross:
Hey that's a really good question Mark! I would guess it's coderanch, but I don't know for sure!![]()
Rob![]()
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!
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
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?
Hi
Why following program prints 10 and 1.0. Any Idea??