Tosin Adedoyin

Ranch Hand
+ Follow
since Nov 09, 2001
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 Tosin Adedoyin

hi
i am a java certified programmer and i am thinking of taking the web component developer exam but i have no experience whatsoever on servlets how do i go about this thanks alot .
Hi
if you pass the beta exam . are you going to get the logo, certificate and everything else that follows like a real certification and can one put in on her resume or are it just a certificate saying u passed the exams
Hi
if you pass the beta exam . are you going to get the log, certificate and everything else that follows like a real certification and can one put in on her resume or are it just a certificate saying u passed the exams
18 years ago
thank you but i thought that when a method is invoked on an object using a reference , it is the class of the current object denoted by the reference not the type of the reference that determines which method implementation will be executed ? so i thought the method test in tube should be called becase l3 is of class Tube

why does the comented line give me an error even though the class of l3 is tube why is it saying that it cannot find the test method in light . i thought it would use the one in tube
[ Jess Added UBB [CODE] tags to preserve whitespace, improve readibility ]
[ June 06, 2002: Message edited by: Jessica Sant ]
Pls can anyone give me some links on where to get good explanations on the >>> ,<<,>> operators and the rule abt the 31 one bit stuff it so confusing to me such that when i take mock exams i just dont bother with the questions cause i believe they are difficult
thank you
class Mock
{
public static void main(String args[]) {
StringBuffer sb1 = new StringBuffer("Amit");
StringBuffer sb2= new StringBuffer("Amit");
String ss1 = "Amit";
System.out.println(sb1==sb2);
System.out.println(sb1.equals(sb2)); // line 2
System.out.println(sb1.equals(ss1));
System.out.println("Poddar".substring(3));
}
}
why does line 2 print false instead of True
Hi corey
thanks but i thought the ans willbe 1 cos at least name will be because it is set to null how do you know when they will eligble is there a hard and fast rule
How many objects are eligible for garbage collection once execution has reached the line labeled Line A?
String name;
String newName = "Nick";
newName = "Jason";
name = "Frieda";
String newestName = name;
name = null;
//Line A
also
37. Which of the following statements about Java's garbage collection are true?
a) The garbage collector can be invoked explicitly using a Runtime object.
b) The finalize method is always called before an object is garbage collected.
c) Any class that includes a finalize method should invoke its superclass' finalize method.
d) Garbage collection behavior is very predictable.
could someone explain the follwing to me
public class X {
}
public class Y extends X {
}
public class Z extends X {
public static void main(String args[]) {

X x = new X();
Y y = new Y();
Z z = new Z();
X xy = new Y(); // compiles ok (up the hierarchy)
X xz = new Z(); // compiles ok (up the hierarchy)


X x1 = y; // compiles ok (y is subclass)
X x2 = z; // compiles ok (z is subclass)

Y y1 = (Y) x; // compiles ok but produces runtime error
Z z1 = (Z) x; // compiles ok but produces runtime error
Y y2 = (Y) x1; // compiles and runs ok (x1 is type Y)
Z z2 = (Z) x2; // compiles and runs ok (x2 is type Z)
Object o = z;
Object o1 = (Y)o; // compiles ok but produces runtime error
}


why does this
Y y1 = (Y) x; // compiles ok but produces runtime error
Z z1 = (Z) x; // compiles ok but produces runtime error
and this
Y y2 = (Y) x1; // compiles and runs ok (x1 is type Y)
Z z2 = (Z) x2; // compiles and runs ok (x2 is type Z)
thanks
hi
i need a good study reference on inner classes / anonymous class and all i thought i had it masterd till i took mock exams also i need to know about bit shifting like when the numbers becomes negative or the stuff on i<< 31 , when negative becomes postive and all i need a good study reference on these topics
can anyone recomend a book or link on the use of assertion in the 1.4 exam
can someone tell me a good link that explains java i/o . i have begining java 2 but i feel i need more
thanks
What will happen if you attempt to compile and run the following code?
class Base {}
class Sub extends Base {}
class Sub2 extends Base {}
public class CEx{
public static void main(String argv[]){
Base b=new Base();
Sub s=(Sub) b;
}
}
1) Compile and run without error
2) Compile time Exception
3) Runtime Exception

i thought the answer will be 1 because of the cast but this was the ans
3) Runtime Exception
Without the cast to sub you would get a compile time error. The cast tells the compiler that you really mean to do this and the actual type of b does not get resolved until runtime. Casting down the object hierarchy as the compiler cannot be sure what has been implemented in descendent classes. Casting up is not a problem because sub classes will have the features of the base classes. This can feel counter intuitive if you are aware that with primitives casting is allowed for widening operations (ie byte to int).
can anyone explain i seem to be confused about object casting