• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

what is the error

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi!

there is not a class Bar in you codes!!!
 
Ranch Hand
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic