Saturday, May 24, 2008

difference of adobe flash and java software in computer?

NB. I can t install any additional software onto the PC I m using- works networked.

class A
{
void set()
{
System.out.println("A s method");
}
}
class C extends A
{
}
class D extends A
{
}
class ins
{
public static void main(String[] args)
{
A a=new A();
//System.out.println(a);
C c=new C();
D d=new D();
a=d;
a.set();
if(a instanceof D)
{
System.out.println(a);
}
if(a instanceof C)
System.out.println("Hello");
}
}
I know that statements a=d and a=c and instanceof statements are resolved at runtime.I want to ask that the statement a.set(); gets resolved at compile time or runtime.At runtime after a=d - a refers to object of D and class D has no set() method .Only A has set method.Still a.set(); gets executed.Why?

Write the codes that print out the following 2 statements:

Student: "Sir- what are your favourite characters?"
Teacher: "There are 3 that I like; \ - " - and . "

--------------
Hmm- anyone knows what are the codes for this question? Do we have to apply the Scanner class? (that is- import java.util.Scanner)?

Thank you.

well if possible do specify course details and fee structure.
I would be very thankful to u !!

No comments: