FreeKB - Public Private Protected in Java
Public Private Protected in Java

Home > Search


Private

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;
}

 

Public

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




Comments