A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

What does it mean private in Java?

Best Answers

It means it cannot be accessed by any other class. If you were to have a class that wanted to use a private method in another class, it would not be allowed. You would have to make that method public, or protected if the class that wants to access the data is a subclass.Mar 11, 2013 read more

HThe public, protected and private modifiers control what other code can see those methods (or fields). It's about controlling the interface you're exposing. The commonly useful ones are: The public modifier: any other can see your method. The private modifier: no code other than your class and any inner classes can see your method. read more

private--> accessible only within the same class where it is declared. Now the confusion arises when it comes to default and protected. default--> No access modifier keyword is present. This means it is available strictly within the package of the class. Nowhere outside that package it can be accessed. read more

public , private and protected are all access modifiers in java. For example a public field in a class is accessible to all the classes while private is only accessible from methods of that class. Instantiated means you have to make a reference for the object you want to use. read more

Encyclopedia Research

Wikipedia:

Image Answers

Further Research

Private and final?
www.javaworld.com

What is Inheritance in Java?
www.techopedia.com