Object-Oriented Design with Java
Other, , Prof. Bjhecker
Updated On 02 Feb, 19
Other, , Prof. Bjhecker
Updated On 02 Feb, 19
4.1 ( 11 )
This video covers the object concept, constuctors, methods, and variables. Here is the source code used in this video
class Employee {
String name;
Double salary;
Employee () {
name = "Joe Smith";
salary = 15.75;
}
String getName(){
return name;
}
String getSalary() {
return salary.toString();
}
public static void main(String[] args){
Employee myEmployee = new Employee();
String retrievedName = myEmployee.getName();
System.out.println(retrievedName);
String retrievedSalary = myEmployee.getSalary();
System.out.println(retrievedSalary);
}
}
Sam
Sep 12, 2018
Excellent course helped me understand topic that i couldn't while attendinfg my college.
Dembe
March 29, 2019
Great course. Thank you very much.