Syvum Home Page

Home > Quiz Games > Java Programming >

Java Programming : Flash Cards II


Learn Java programming through these flash cards.

Formats Worksheet / Test Paper Quiz Review
Flash Cards



Consider the following code:
class A
{
void method(int x)
{ System.out.println("x =" + x); }
}
class B extends A
{
void method(int y)
{ System.out.println("y =" + y); }

void method(String s)
{ System.out.println("s =" + s); }
public static void main(String args[ ])
{
A a1 = new A( );
A a2 = new B( );
a1.method(10);
a2.method(20);
}
}
What will be the output, when executed?
 



Print Flashcards
Create Your Own Flash Cards


Contact Info © 1999-2018 Syvum Technologies Inc. Privacy Policy Disclaimer and Copyright