VVed

Greenhorn
+ Follow
since Apr 07, 2000
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 VVed

JRoch u are right.
21 years ago
Method overloading is one of the ways that Java implements polymorphism.
Overridden methods allow Java to support run-time polymorphism.
ie. Overridden methods are another way that Java implements the "one interface, multiple methods" aspect of polymorphism.
this answer is according to my knowledge gained from a book called "The Complete Reference (JAVA2 third edition)"
please check pg.158(Overloading Methods) & pg.215(Overridden Methods)
if this is not the case then please give me a detailed explaination for this.
21 years ago
hi JRoch
class Test{
int x = 5;
static String s = "abcd";
public static void method(){
System.out.println(s + x);
}
}
in the above code method() is static hence it will be executed once. there is no need for a call to method(). and the answer 4 is perfectly right if int x is made static then the above code will display "abcd5"
21 years ago