The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

abstract class Graphics

Posted by kaushik saha on January 04, 2001 at 11:53 PM

if that is the case, our own programme should work properly.But the programme written below is giving an error "a may not have been initialised".Please help in this regard.

abstract class one{
abstract void show();
void show1(){
System.out.println("This is from show1");
}
abstract void show2();
}
class two extends one{
void show(){
System.out.println("This is from show defined in class two");
}
void show2(){
System.out.println("This is from show2 defined in two");

}
}
class three extends two{
void display(one ob){
ob.show();
ob.show1();
ob.show2();
}

static void main(String args[]){
three th= new three();
one a;
th.display(a);
}
}




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us