FreeKB - Understanding Public Private Protected
Java Programming - Understanding Public Private Protected


The object can only be used in the class. In this example, the "name" string is private, which means that "name" can only be used in the "example" class.

public class example {	

	private String name;



Can be used anywhere.

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 08910 in the box below so that we can be sure you are a human.