You are on page 1of 4

Assignment on

instance variables and methods


Submitted by:
Name: Md Anik Hosan
Id:201-35-572
Section: Ac-D
Subject: SE-211 Object oriented concept

Submitted to:
Name: S A M Matiur Rahman
Associate professor & associate head
Department of Software Engineering

Submitted on: 6rd April 2021

1
Answer to the question no:1

class Bicycle {
// Data Members
private String ownerName;
private String tagNo;
//Constructor: Initialzes the data member
public void Bicycle( ) {
ownerName = "Unknown";
tagNo = "Unassigned";
}
......
}
Answer to the question no:2

class Bicycle {
......
public void setTabNo(String number) {
tagNo = number;
}
......
}

Answer to the question no:3

class Bicycle {
......
Public String getTagNo( ) {
return tagNo;
}
......
}

You might also like