Professional Documents
Culture Documents
Topic 3 Part 2
Topic 3 Part 2
OBJECT ORIENTED
PROGRAMMING
Topic 3:
Basic Concepts Of Classes
(Part 2)
LESSON OUTCOME
CLASS OBJECT
Class Program App Program
Class header
Main method
CLASS CONCEPT
void method
void method
return method
MATCHING
ARGUMENTS
AND PARAMETERS
MATCHING ARGUMENTS AND
PARAMETERS
Class name: Demo
MATCHING ARGUMENTS AND
PARAMETERS
Application class :
Mutator method : to
public void setData(String n, String m, double h) set the object’s value
{
Method definition actName = n;
movieName = m;
hourWork = h; }
public class ActorApp Class header : modifier, reserved word class and class name
{
public static void main(String[] args) Main method
{
Scanner a = new Scanner(System.in); Create input object : to input using
I/O console
2. From the example of Actor and its application above, add the coding to the
programs to do the following tasks:
a) Add the retrievers for each attributes.
b) Add a processor to calculate actor’s payment, let the payment made by
RM350 per hour.
c) In the application class, display the actor’s name and the payment made.
d) Display the actor’s information with payment more than RM1000.
TEST YOURSELF 1