0% found this document useful (0 votes)
17 views2 pages

Encapsulation

Uploaded by

marcmercado2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Encapsulation

Uploaded by

marcmercado2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Republic of the Philippines

ISABELA STATE UNIVERSITY - ANGADANAN CAMPUS


BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY PROGRAM
IT ELEC 2: OBJECT-ORIENTED PROGRAMMING

LABORATORY ACTIVITY IN ENCAPSULATION

NAME:______________________________________ YEAR|SECTION:_____________________

PROBLEM : Write a Java program to create a class called Product with private instance variables
productName, productCode, and price. Provide public getter and setter methods to access and
modify these variables. Add a method called applyDiscount() that takes a percentage and
reduces the price by that percentage.

WRITE/PASTE YOUR PROGRAM CODE BELOW:

PROGRAM OUTPUT :

You might also like