Ravi Pinnaboyina

Greenhorn
+ Follow
since Feb 19, 2007
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 Ravi Pinnaboyina

Once again thanks a lot for all of U ........

Can anyone tell me info for logging in to the certmanager site I am not able to login , Is it compulsory to get registered in to the site??
17 years ago
All constructors must declare the uncaught checked exceptions, if any.

Instance Initializers in anonymous classes can throw any exception.


I couldnt understand the second point, can someone give me an example....
Top level classes mean that classes that are not inner classes, not the classes which have a main method.
So it means that i and j will only be declared first only then assignment starts...

i.ie.,

int a=10;
int b=10;

first a nd b will be declared only then they get initialized???
Am I right??
How the output is printed as Zero.......
How is the value of i being resolved ?


private int i=getData();
private int j=10;

int getData()
{
return j;
}

public static void main(String arg[])
{
System.out.println(""+new ASample().i);
}
Is it that U need a code that can generate IOException to have a catch block for IOException.

Is this same even for remaining Exceptions ???

Then If dont write a any code and keep an Exception catch block why is this not complaining?
Is this behaviour specific to IOException only???
Why is this saying Unreachable code...?? Anything special for IOException

public static void main(String args[])
{

try
{
}
catch(java.io.IOException t)
{
System.out.println("Inside Catch");
}
}
thanks Javier Now Iam clear with this.
Is this same even in case of Interfaces.... Does we get a class cast Exception when using Interfaces?

Does the same rules apply to casting objects to interfaces?
[ February 19, 2007: Message edited by: Ravi Pinnaboyina ]
UNREACHABLE code since system.out.println is never executed since everytime you are throwing an Exception without any condition.
hi frenz,

I had a doubt regarding Casting Objects to one another I understood about implicit casting, But when it comes to explicit conversions when does it throw Compile time Error and when does it give Runtime Exception(Classcast Exception).