aspose file tools*
The moose likes Beginning Java and the fly likes Basic Privacy Question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Basic Privacy Question" Watch "Basic Privacy Question" New topic
Author

Basic Privacy Question

golfinguy4
Greenhorn

Joined: Apr 17, 2002
Posts: 1
Say I have a class foo. In the class, there is a method whatever which takes an argument of type foo. Would the method be able to access the private members of the argument?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24166
    
  30

Hey Guy,

Welcome to JavaRanch!

First, a bit of business: you may not have read our naming policy on the way in. It requires that you use a real (sounding) first and last name for your display name.
You can change your display name here. Thanks.

Now, the answer to your question: yes. Protection is on the class level. Objects of the same class can't protect themselves from each other.
[ November 18, 2004: Message edited by: Ernest Friedman-Hill ]

[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Basic Privacy Question
 
Similar Threads
Passing the method's return as argument
Objects in method arguments
argument -defined Anonymous inner class
overloading doubt
Argument-defined anonymous class call