x
Menu

Object-Oriented Design with Java

Other, , Prof. Bjhecker

Updated On 02 Feb, 19

Overview

Includes

Lecture 9: OO Design in Java - Tutorial 3 part 2

4.1 ( 11 )


Lecture Details

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

Ratings

0


0 Ratings
55%
30%
10%
3%
2%
Comments
comment person image

Sam

Excellent course helped me understand topic that i couldn't while attendinfg my college.

Reply
comment person image

Dembe

Great course. Thank you very much.

Reply
Send