Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Mira Chandra Kirana

Informatics Engineering
Politeknik Negeri Batam
More than one methods
(same name) in a class

Different parameters
class Student {
void Study (double grade) {
//statement1
}

void Study (String subject) {


//statement2
}
}
Methods?
• Same name with class ?
• Overloading?

Easier to make objects?


• Executed when Object’s
created
Name?

class Car {
public Car() {
Same
//statement
Name
}
}
Overloading ?
class Car {
public Car() {
//statement1
}
public Car(String brand) {
//statement2
Are they
}
same ?
}
Executed when Object’s created
Class name

public Member ( ){
owner = “No Name”;
}

-----------------------------------------------

Member member1 = new Member(); //instantiation


Summarize overloading method and constructor
using trusted references(minimum 2) with your
own wordsand give the examples.

Submit your exercise and task as “pdf “


named T5_NIM
Thank you

You might also like