Week3 PP OOP Object Classes
Week3 PP OOP Object Classes
Programming vs Object
Oriented Programming
CCPRGG1L- Fundamentals of Programming
Opening Prayer
Heavenly Father,
We thank You and praise You! You are the everlasting God.
Please prepare our hearts and minds to learn. To the best of our
ability today.
Please bless us as we study. Please help us to grow.
May Your protection be upon us as we go about our day.
Amen
Checking of Attendance
Attendance with a TWIST
1. Nagmahal po sir
2. May crush po sir
3. Nasaktan po sir
4. Study po sir
5. Umaasa pa rin po sir
6. Nag-GHOST po sir
Let’s do a RECAP
At the end of the session, the students shall be able to:
• Understand the basic concepts of Procedural Programming and
Object-Oriented Programming
• Learn how to declare and use classes and objects in Java
Procedural Programming
Procedural Programming
• Traditional programming languages were procedural.
❖ C, Pascal, BASIC, Ada and COBOL
• Data hiding is the ability of an object to hide data from other objects in the
program.
Objects
Object is an instance of a class. It is a basic unit of Object-Oriented Programming and
represents the real-life entities. A typical Java program creates many objects, which as
you know, interact by invoking methods. An object consists of :
System.out.printn("1st number:");
double n = type.nextDouble()
double z = n+x;
System.out.println("The sum is:" +z);
}
Instantiation and Initialization
Constructors are used for initializing new objects.
Fields are variables that provides the state of the
class and its objects, and methods are used to
implement the behavior of the class and its objects