give an example for encapsulation?
Answer / Himanshu Saxena
Encapsulation can be demonstrated through a class named Employee, where the data members like name, age, and salary are private and can only be accessed by public getter and setter methods.
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the important features of Java 8 release?
What should I import for arraylist in java?
How we can execute any code even before main method?
What is private protected in java?
why java does not have operator overloading?
Why are generics used?
What is unicode?
What are the 8 primitive data types in java?
what are the states associated in the thread? : Java thread
How many arguments can be passed to main ()?
what is abstract method with example?
What is hasnext in java?