Java - 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 a3679 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |