• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Question from marcus green mock exam

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

1) Compile Error: Methods in Base not found
2) Compile Error: Unable to access protected method in base class
3) Compilation followed by the output "amethod"
4)Compile error: Superclass Class1.Base of class Class1.Class1 not found

Ans given is 4
but i cheked ,it compiles & runs fine with o/p amethod.Shouldn't the answer be 3?
Thanks
Veena
[ Jess fixed the code so you can actually read it, please be more careful when cutting and pasting code so that we can read it and help! ]
[ October 20, 2003: Message edited by: Jessica Sant ]
 
Ranch Hand
Posts: 504
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Veena, can you make it more readable? I had hard times reading the code.
These classes are in different packages, Base.java is marked as default access, and, to make things worse, package Base is not imported into Class1.java. This shouldn't compile.
P.S. Thanks Jess, I thought it was local on my computer.
[ October 20, 2003: Message edited by: Vad Fogel ]
[ October 20, 2003: Message edited by: Vad Fogel ]
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh!I got it.Thanks and really sorry for pasting code as it is.
Thanks
Veena
 
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic