• 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

Q from javaBeat on Declaration & Access Control

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[mock question removed]
[ April 21, 2008: Message edited by: Ben Souther ]
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please look at the class modifier.."Default".
 
Ranch Hand
Posts: 180
Netbeans IDE Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A:is worng because Target is not public.
B:is worng because other classes int test package can access name because it is public.
D:is worng because any subclass of Target of diffrent package can't access it.(Target is NOT public).

(First see the class VISIBILITY then member VISIBILITY)
 
Nevin kumar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you ..
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Naveen, could you post a link to the javabeat question you got this from as I cannot find it myself in any of the online mock exams/sample questions, nor in the questions I purchased from them recently.
Thanks.
 
Nevin kumar
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry it's not from javaBeat,it's from some mock I could'nt remember as I'm randomly doing from different materials.
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sorry it's not from javaBeat,it's from some mock I could'nt remember as I'm randomly doing from different materials.



Please be real careful here. The JavaRanch seems to be getting a rash of "source quotes" which are intentional done to hide the real source. (generally due to copyright issues).

I'm not saying that it is true in your case, but we have deleted whole groups of questions from a single poster, in the past, because of this. Please help the ranch, and your fellow posters, by keeping track of the sources.

Henry
 
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That means, with default modifier any class in package can access any variable defined by that class of package .

Correct me if i am wrong...
[ April 20, 2008: Message edited by: Dinesh Tahiliani ]
 
What a stench! Central nervous system shutting down. Save yourself tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic