Srinivas Tuta

Greenhorn
+ Follow
since Oct 12, 2005
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 Srinivas Tuta

what is null in java. Is it of type object or string.

why the line of code below is giving error.

System.out.println(null)

Regards,
Srinivas
[ April 04, 2006: Message edited by: Srinivas Tuta ]
Hi,

using throw you can throw an exception.

when u say a method throws an execption, u are reporting the compiler that the method is capable of throwing an exception, which you are not catching.


Srinivas
SCJP1.4
[ February 02, 2006: Message edited by: Srinivas Tuta ]
Hi,

outer while loop loops for three times.

first loop : inner do-while loops for four times j=0,j=1,j=2,j=3

second loop: since do-while j=4

third loop: j=5

outer loop breaks as i became 3

thankyou
Srinivas
Hi Bill Howerton,

In your code while instantiating privatedemo object refer it to privatebase class.

privatebase pd = new privatedemo(); //1
pd.amethod();//2

Line 2 will not compile saying that amethod has private access in privatebase, which means that you cannot override private methods.

thankyou,
Srinivas
SCJP1.4
[ January 28, 2006: Message edited by: Srinivas Tuta ]
Hi,

Here derived class object is referred to a base class type reference variable which is perfectly legal.

when we invoke a method on this type of variable, at compile time JVM looks for the method in base class, and since it exists it compiles. also static methods and instance variables all are invoked at compile time which means, base class values are invoked.

but actually in runtime, the method in the object which is being passed to this variable is invoked for instance methods.

this is also called runtime polymorphism or dynamic method dispatch.

Srinivas
SCJP1.4

[ January 24, 2006: Message edited by: Srinivas Tuta ]
[ January 24, 2006: Message edited by: Srinivas Tuta ]
Hi friends,

I have passed SCJP1.4 on Nov 30 2005. I didnt received my certificate till now. In general, after how many days we will receive the certificate. Is there any website to see whether our certificate is dispatched or not.

Plz reply,

Thanks,
Srinivas
18 years ago
In method m2() of class D, the methods being invoked at runtime are of current object (since this), which means everytime method m1() of the instance of class D is invoked. Since D is derived from C and also from B, A indirectly, the its current object can actually be referred by their super class reference types and hence typecasting to C , B, A is allowed. But at runtime the object being passed is this, means current object.


Srinivas
SCJP1.4
Hi..

Can anybody clear my doubt...what does System.out.println(t) will do on t.. if t is an object.

If it calls toString() method on that object, why im not getting null pointer exception when t is equal to null