Friday, April 14, 2017

Java Classes and Objects

Here is the code for creating a Java class. This will create an employee detail class. Note the class has a private method which computes the allowance. This is used by the method which computes and returns the salary. There are also two methods to set and retrieve instance variables. These are sometimes called setters and getters.

In a later post we will instantiate an object from this class. We will resume our parallel Python files when we return to working on the Python course. Click on the image for an expanded view of the Java class on box.com.

 View expanded image on box.com


No comments:

Post a Comment