Kaushik Subramanya

Greenhorn
+ Follow
since Sep 26, 2000
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 Kaushik Subramanya

Ajit,
There has been quite a bit of confusion (at least in my case) about the inner classes. Can you once and for all sum it all up and post the correct features of the Inner classes
Sorry for disrupting your extended vacation
~Kaushik

Originally posted by Ajith Kallambella:
[B]Here is a summary of types of classes

Hope this helps!
Ajith
[This message has been edited by Ajith Kallambella (edited July 13, 2000).][/B]


Thanks all...
My doubts are clear
~Kaushik

Originally posted by Adrian Yan:
The first one a) is the only correct answer.
The second question, remember this:
For methods, it's the methods of actual object that the reference denotes at runtime that gets execute.
For variable, it's the variables of object that the reference denotes at compile time that gets execute.
I know it's confusing, it took me awhile to understand it.
Let me know if you let more help.


Originally posted by Adrian Yan:
The first one a) is the only correct answer.
The second question, remember this:
For methods, it's the methods of actual object that the reference denotes at runtime that gets execute.
For variable, it's the variables of object that the reference denotes at compile time that gets execute.
I know it's confusing, it took me awhile to understand it.
Let me know if you let more help.


Nasir,
Static variables are automatically initialized.
Hope that helps
Kaushik

Originally posted by Nasir Khan:
Hi,
I have a problem with this code
_________________________
class X{static int i=5;} //line 1

class Y{
static X method(){return null;}//line 2
public static void main(String st[]){
int g=method().i;
System.out.println(g);
}
}
__________________________
Obviously there should be a NullpointerException
but its giving an output of 5
but when i remove static either from line1 or line2
there is NullpointerException.....
Please help me on this....


All,
Here are some questions for which I am not able to get the right answer.
Which statements are accurate:
a) >> performs signed shift while >>> performs an unsigned shift.
b) >>> performs a signed shift while >> performs an unsigned shift.
c) << performs a signed shift while <<< performs an insigned shift.
d) <<< performs a signed shift while << performs an unsigned shift
I think it is b.
But says it is wrong..
--------------------------------------------------------------
class Super
{ int index = 5;
public void printVal()
{ System.out.println( "Super" );
}
}
class Sub extends Super
{ int index = 2;
public void printVal()
{ System.out.println( "Sub" );
}
}
public class Runner
{ public static void main( String argv[] )
{ Super sup = new Sub();
System.out.print( sup.index + "," );
sup.printVal();
}
}
What will be printed to standard output?
a) The code will not compile.
b) The code compiles and "5, Super" is printed to standard output.
c) The code compiles and "5, Sub" is printed to standard output.
d) The code compiles and "2, Super" is printed to standard output.
e) The code compiles and "2, Sub" is printed to standard output.
f) The code compiles, but throws an exception
correct answer is c. Not able to understand how.
----------------------------------------------------------------
Any light would be appreciated.
Kaushik
Bill,
Thanks for an excellent explanation. Would be helpful if you cud explain the >>> operation too. I am having some trouble understanding the same.
Your help is greatly appreciated.
~Kaushik
All,
Can anyone tell me how do I catch and handle exceptions within my constructor.
~Kaushik
Read the Bible - Ed Roman - It is available on the web http://www.theserverside.com
~Kaushik

Originally posted by Raghavendra Holla:
Hello,
I am starter for this. Can anyone suggest best & Comprehensive book for EJB. Thanks in advance.
Regards,
Holla.


Has anyone tried to customize the JTreeTable that is present on Suns Web site.
http://java.sun.com/products/jfc/tsc/articles/treetable1/index.html
Any help is greatly appreciated.
Thanks in advance
Kaushik
------------------
23 years ago