• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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
 
Tell me how it all turns out. Here is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic