Vidya Selvaraj

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

Recent posts by Vidya Selvaraj

Refer to
http://www.javaranch.com/maha/
http://www.javaranch.com/maha/_Mock_Exams/_mock_exams.html
[This message has been edited by Vidya Selvaraj (edited December 09, 2000).]
It is the " Complete Java 2 Certification Study Guide" by
Simon Roberts
Philip Heller
Michael Ernest
[This message has been edited by Vidya Selvaraj (edited December 09, 2000).]
Milind, buttons are added to the panel(flow layout), then Panel is added to the frame. Hope this is clear
Thanx
Vidya
Amrit, This example was picked from Maha's Collection of Thread!. I added some more scenario's for my own clarification. Scenario 11 & 12 might be what you are looking for!

Correct me if this is wrong!
Thanx
Vidya
[This message has been edited by Vidya Selvaraj (edited December 06, 2000).]
Jason,
Refer to this!
http://suned.sun.com/USA/certification/progdetails.html
& the passing score is 61%
All the best
Vidya
Hi Srinivasan,
Ok I am assuming that you are referring to K = 0 after i = new int[10];
After the line i = new int[10], the value of K is 6. if you remove k =0, The i[K] in
for(int j = 1000; j < 1010; j++)
{
i[k] = j;
k++; //Line in question.
}
will start with i[6], the for loop is performed 9 times, which will cause k value or i[k] go upto i[14]. Here is the problem. i is defined only as i[10], hope you got the point now!
Thanx
Vidya
[This message has been edited by Vidya Selvaraj (edited December 04, 2000).]
I do not get any exception if I remove k++; It compiles fine & the o/p is 1000 to 1005, 1009, & 9 zeroes
Answer to your first question:
http://www.javaranch.com/ubb/Forum24/HTML/001464.html
[This message has been edited by Vidya Selvaraj (edited December 03, 2000).]
Hi Dipali,
I am not sure whether you are asking about -N >>> S or -N >> S. -N >> S has a clear explanation given by Santhosh & Rajani.

Remember if S = 32 or 64 for int or long,
whatever you do for +/- N >>, <<, >>> S, the shift will not be performed, For eg: -5 >>> 32 = -5; -6 << 32 = -6; 6 >> 32 = 6
Thanx Amond, now its perfectly clear
- Vidya
[This message has been edited by Vidya Selvaraj (edited December 02, 2000).]
" can't shift further than the number of bits in the left-hand argument (int or long). Only the five (six) low-order bits of the right-hand argument will be used to shift an int (long) "
Can someone explain this clearly??
Thanx
Vidya
With SuperClass sup = new SuperClass();, O/P is
C:\jdk1.3\bin>java SuperClass
Super Constructor
SuperClass
super class a method
SuperClass
With SuperClass sup = new SubClass();, O/P is
C:\jdk1.3\bin>java SuperClass
Super Constructor
SubClass
super class a method
SubClass
Subclass amethod
SubClass
Subclass Constructor
SubClass
I modified the code a little bit for clear understanding:
class SuperClass {
public SuperClass(){
System.out.println("Super Constructor");
System.out.println(getClass().getName());
amethod();
}
public void amethod() {
System.out.println("super class a method");
System.out.println(getClass().getName());
}
public static void main(String[] args) {
SubClass sub = new SubClass();
}
}
class SubClass extends SuperClass {
public SubClass() {
System.out.println("Subclass Constructor");
System.out.println(getClass().getName());
}
public void amethod() {
super.amethod();
System.out.println("Subclass amethod");
System.out.println(super.getClass().getName());
}
}
/* Ouptut is:
C:\jdk1.3\bin>java SuperClass
Super Constructor
SubClass
super class a method
SubClass
Subclass amethod
SubClass
Subclass Constructor
SubClass
*/
Thanx
Vidya
Correct answer is "C"