Utkarsh Chowdhary

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

Recent posts by Utkarsh Chowdhary

Why Java is said to be platform independent while C & C++ is not when Java Complier & JVM is different for every OS .?
24 years ago
If i want to write a program as given below where should I define void show(); method.I want the paint(Graphics g) in the AwtTest class should get invoked by writing only new AwtTest();



(edited by Cindy to add formatting)
[This message has been edited by Cindy Glass (edited March 26, 2001).]
24 years ago
We say abstract class object can't be created.Then how Abstract class Graphics referance is passed in the method paint(Graphics g).When mehod inside abstract class like drawLine is also abstract then where it is defined?
Also plz tell me how the paint method is invoked automatically?
24 years ago
Why Java is said to be platform independent while C & C++ are not when Java Complier & JVM is different for every OS .?
Interfaces are designed to support dynamic method resolution at run time.
Please explain this.

Does static void t(CanFight x)
means CanFight i=new Hero();
if yes then how it can refer to a ActionCharacter fight() method?


Please use [ code] [ /code] tags to format your code. Check out the UBB Code link below for further details


Thanks

[This message has been edited by Rahul Mahindrakar (edited March 13, 2001).]
class Base{
int i=100;
void show(){
}
}
class Derived extends Base{
int i=10;
void show(){
}
When i say
Base b=new Derived();
b.show();
System.out.println(b.i);
b.show(); calls the method of the Derived class
that's ok.But why b.i is bringing Base variable value.
& not Derived one.
When we say Base b then b refers to class Base & when
we say b=new Derived(); then b points to Derived object.Please explain this in terms of memory allocation.
24 years ago