Oop L4
Oop L4
Programming
BITS Pilani
CS F213
Dubai Campus SAPNA SADHWANI
Contents
• Classes and Object Examples
• Object Reference
• Constructor
• Example
• Method overloading
• Example
• Constructor overloading
• Example
• this keyword
• Example
Source:
1. Chapter 1, Cay Horstmann, Object Oriented Design & Patterns, John Wiley & Sons, 2006, 2nd Edition
2. Chapter 6, 7, Herbert Schildt, The complete Reference Java 2, 5th Edition, Tata McGraw Hill.
3. https://www.programiz.com/java-programming/constructors
4. https://beginnersbook.com/2013/05/method-overloading/
Student s2 = s1;
s2 also is a reference to the same object s1.
Its not a copy.
Student
s1 name = “abc”
age = 10
s2
Thank You!