Skip to content
Snippets Groups Projects
Commit 4734018a authored by VIGNESH VIJAYAKUMAR's avatar VIGNESH VIJAYAKUMAR
Browse files

Encapsulation main class

parent 3ee95870
No related branches found
No related tags found
No related merge requests found
public class Enmain{
public static void main(String[] args){
Encls encls_obj = new Encls();
//encls_obj.name = "Jhon";//throw error bcoz name is private var in Encls
encls_obj.setData("Jhon");
String name = encls_obj.getData();
System.out.println("Name from encapsulation private : "+name);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment