File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the error

 
nikunj thakur
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
class Foo8
{
public void doFooStuff()
{
System.out.println("a");
}
public void doFooStuff1()
{
System.out.println("c");
}

}
public class Bar8 extends Foo8
{
public void doFooStuff()
{
System.out.println("b");
}
}
class Test
{
public static void main (String [] args)
{
Foo8 reallyABar = new Bar();
reallyABar.doFooStuff();
//reallyABar.doFooStuff();
//reallyABar.doFooStuff1();


// Legal because Bar is a
// subclass of Foo
// Bar reallyAFoo = new Foo(); // Illegal! Foo is not a
// subclass of Bar
}
}

i am getting exception in thread main error
what is the reason for that
 
Fu Dong Jia
Ranch Hand
Posts: 131
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!

there is not a class Bar in you codes!!!
 
dhwani mathur
Ranch Hand
Posts: 621
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi thr

i think Fudong Jia is right


there is no class Bar in your code
but the class name must be Bar8...................
isnt it?

 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic