RAVI BHAWNANI

Greenhorn
+ Follow
since Jan 29, 2001
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 BHAWNANI

thanks .i have received your mail
soon will be back with new query
why do daemon threads keep on running even when we are delieberately killing the execution of main thread
Q1. CAN INNER CLASSES BE EXTENDED ?IF YES PLEASE TELL ME WHAT IS WRONG WITH
THIS CODE.

//problem begins here .compiler is unable to find the default constructor of Inner2


Q2.CAN STATIC METHODS BE OVERRIDED ?
ANS . THE ANS TO THIS QUESTION IS PROBABLY NO.
BUT STATIC METHODS CAN BE OVERRIDED AS STATIC .
BUT IT IS GENERALLY NOT MENTIONED IN EXAM WHETHER
TO OVERRIDE THE METHOD AS STATIC OR NON STATIC.
SO WHAT SHOULD BE OUR APPROACH TO THE QUESTION.

Q3.CAN THE INBUILT METHODS LIKE SLEEP(),WAIT(),SUSPEND(),
NOTIFY () ETC BE SYNCHRONIZED.IF YES PLEASE GIVE ME AN ILLUSTRATION.



Q4.DO THESE METHODS MENTIONED ABOVE IN Q3 RELEASE MONITOR WHEN THEY ARE
INVOKED?


Q5 DO SHIFT OPERATORS AUTOMATICALLY WRAPS UP THE VALUE OF PRIMITIVES
WHEN REQUIRED?
EX. int i=1;
i<<31; #ANS IS -2147483648.WHY?
IT SHOULD GENEATE AN ERROR "LOSS OF PRECISION."
2 RAISE TO 31 =2147483648 WHICH IS BEYOND THE LIMIT OF int.

Edited by Madhav:
Doesn't it look good when indented. Its not very difficult you know.....regds - satya


[This message has been edited by Madhav Lakkapragada (edited January 30, 2001).]
23 years ago
Q1. CAN INNER CLASSES BE EXTENDED ?IF YES PLEASE TELL ME WHAT IS WRONG WITH
THIS CODE.
class Inne{
int i=10;
public void add(){
System.out.println("add");
}
static class Inner1 {
static int j=20;
public static void sub(){
System.out.println("sub");
}
//problem begins here .compiler is unable to find the default constructor of Inner2
static class Inner2 extends Inner1.Inner2 {
static int j=20;
public static void div(){
System.out.println("div");
sub();
}//end of div
}//end of Inner2
public static void main(String args[]){
Inner in=new Inner();
Inner.Inner1 in1=in.new Inner1();
Inner.Inner1.Inner2 in2=in1.new Inner2();
in2.div();

}//end of main()
}//end of Inner1
}//end of Inner



Q2.CAN STATIC METHODS BE OVERRIDED ?
ANS . THE ANS TO THIS QUESTION IS PROBABLY NO.
BUT STATIC METHODS CAN BE OVERRIDED AS STATIC .
BUT IT IS GENERALLY NOT MENTIONED IN EXAM WHETHER
TO OVERRIDE THE METHOD AS STATIC OR NON STATIC.
SO WHAT SHOULD BE OUR APPROACH TO THE QUESTION.

Q3.CAN THE INBUILT METHODS LIKE SLEEP(),WAIT(),SUSPEND(),
NOTIFY () ETC BE SYNCHRONIZED.IF YES PLEASE GIVE ME AN ILLUSTRATION.



Q4.DO THESE METHODS MENTIONED ABOVE IN Q3 RELEASE MONITOR WHEN THEY ARE
INVOKED?


Q5 DO SHIFT OPERATORS AUTOMATICALLY WRAPS UP THE VALUE OF PRIMITIVES
WHEN REQUIRED?
EX. int i=1;
i<<31; #ANS IS -2147483648.WHY?
IT SHOULD GENEATE AN ERROR "LOSS OF PRECISION."
2 RAISE TO 31 =2147483648 WHICH IS BEYOND THE LIMIT OF int.
23 years ago