ramani2020

Greenhorn
+ Follow
since Sep 14, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by ramani2020

Hi Sheri..
I think C and D are right..
see this post for option E.
HTH,
Ramani.

Hi Bergling,
I agree ,C and D are right.
see this code regarding option B:

when line //a is uncommented, the compiler gives an error saying line not reached.
it means you can't have a return inside finally?
Ramani.
The quote is from JLS 5.1.7,
I didnt understand this really well.


Except for the String conversions, there is no permitted conversion from any primitive type to any reference type.


this might sound stupid,but I dont understand how a primitive type is converted to a reference type in String conversion.
could somebody explain,please?
thanks,
ramani.

I think Sampath is right.
JLS experts, do come up...
I have this doubt on interfaces...
interface abcd
{
void method() throws Exception ;
}
class ABCD implements abcd
{
public void method(){}
}
the above code,compiles.I thought method() in class ABCD should also throw Exception .
could somebody tell why this is legal?
thanks,
Ramani.
I thot it would be null,but I was wrong.
what is the default value of o when o is of type Object?
as in :
Read the code below. Will be the result of attempting to compile and run the code below.


Answers
1.The code does not compile.
2.The code compiles cleanly and shows "Object Version".
3.The code compiles cleanly and shows "String Version"
4.The code throws an Exception at Runtime.

the answer given is 3.
I tried this small code:

this prints out java.lang.Object@f5ac7215
when I run it again,it gives a different thing after the '@'
I guess this is the address of o.but why is it different each time?
could somebody help?
thanks.
Ramani.

yup! I couldnt be more dumb
I guess I shd start from scrap 'gain...
thanks Surya..
Ramani.
I didnt understand option E of Qn 17
Primitive type wrapper classes


Are provided for all primitive types, including void


void, primitive type? what is being said here?
could somebody explain ,please?
thanks in advance..
Ramani.

excellent analogy, Jane...

Ramani.
Hi..
pl look at this code:

the code gives NullPointerException on lines 8 and 17
whether line 7 is commented or not
when the line is commented, what is the class of nI? Object,I guess. then why is it not displaying the class in line 8 and throwing an exception instead?
when line 7 is not commented, the test in line 9 fails ,and "no" should be printed..
could somebody explain please?
thanks in advance
Ramani.
anil,you are implementing interface a, not interface b.
the inner interface just happens to be a member interface of the outer one.
so the compiler results are right..
am I correct? more inputs from somebody are welcome.
Ramani.

Satish,The gridwidth and gridhieght parameters indicate the number of cells allotted to the component horizontally and vertically .I dont think they decide the number of rows and columns.
could somebody come up with the correct answer,please?
thanks,
Ramani.
from Bill Brogden's Java2 Exam Cram,


Container was an abstract class in Java 1.0 and 1.1,but for the Java JDK1.2 it is no longer declared abstract.


HTH,
Ramani.
Congrats!
please send me links to the mocks you took at ramani2020@yahoo.com
thanks a lot..
Ramani.
hi geetha,
But anonymous classes, by definition, dont have a constructor or a name.
If the class extends another class which has a constructor, the inner class is not anonymous ..am I right? or am I missing something?
could you give an example ?
or,could you tell me what modifications are to be made to convert the foll into an anonymous class like you said, extending from class father, and without a name..

thanks in advance,
Ramani.


i think 1 and 4 are right..
correct me if I am wrong..
Ramani.