Java Notes – OOP Concepts
Classes and Objects (Part 1)
Basic building blocks of Java.
Definition of Classes and Objects
Use cases of Classes and Objects
Common mistakes in Classes and Objects
1. Step-by-step working of Classes and Objects
2. Best practices for Classes and Objects
3. Real-world application of Classes and Objects
// Example for Classes and Objects
public class Example {
public static void main(String[] args) {
[Link]("Classes and Objects example");
}
}
Encapsulation (Part 1)
Data hiding using access modifiers.
Definition of Encapsulation
Use cases of Encapsulation
Common mistakes in Encapsulation
4. Step-by-step working of Encapsulation
5. Best practices for Encapsulation
6. Real-world application of Encapsulation
// Example for Encapsulation
public class Example {
public static void main(String[] args) {
[Link]("Encapsulation example");
}
}
Inheritance (Part 1)
Reusing code via extends.
Definition of Inheritance
Use cases of Inheritance
Common mistakes in Inheritance
7. Step-by-step working of Inheritance
8. Best practices for Inheritance
9. Real-world application of Inheritance
// Example for Inheritance
public class Example {
public static void main(String[] args) {
[Link]("Inheritance example");
}
}
Polymorphism (Part 1)
Method overloading and overriding.
Definition of Polymorphism
Use cases of Polymorphism
Common mistakes in Polymorphism
10. Step-by-step working of Polymorphism
11. Best practices for Polymorphism
12. Real-world application of Polymorphism
// Example for Polymorphism
public class Example {
public static void main(String[] args) {
[Link]("Polymorphism example");
}
}
Abstraction (Part 1)
Abstract classes and interfaces.
Definition of Abstraction
Use cases of Abstraction
Common mistakes in Abstraction
13. Step-by-step working of Abstraction
14. Best practices for Abstraction
15. Real-world application of Abstraction
// Example for Abstraction
public class Example {
public static void main(String[] args) {
[Link]("Abstraction example");
}
}
Interfaces (Part 1)
Pure abstraction.
Definition of Interfaces
Use cases of Interfaces
Common mistakes in Interfaces
16. Step-by-step working of Interfaces
17. Best practices for Interfaces
18. Real-world application of Interfaces
// Example for Interfaces
public class Example {
public static void main(String[] args) {
[Link]("Interfaces example");
}
}
Access Modifiers (Part 1)
public, private, protected.
Definition of Access Modifiers
Use cases of Access Modifiers
Common mistakes in Access Modifiers
19. Step-by-step working of Access Modifiers
20. Best practices for Access Modifiers
21. Real-world application of Access Modifiers
// Example for Access Modifiers
public class Example {
public static void main(String[] args) {
[Link]("Access Modifiers example");
}
}
this and super (Part 1)
Keywords usage.
Definition of this and super
Use cases of this and super
Common mistakes in this and super
22. Step-by-step working of this and super
23. Best practices for this and super
24. Real-world application of this and super
// Example for this and super
public class Example {
public static void main(String[] args) {
[Link]("this and super example");
}
}
Object Class (Part 1)
Root class of Java.
Definition of Object Class
Use cases of Object Class
Common mistakes in Object Class
25. Step-by-step working of Object Class
26. Best practices for Object Class
27. Real-world application of Object Class
// Example for Object Class
public class Example {
public static void main(String[] args) {
[Link]("Object Class example");
}
}
Wrapper Classes (Part 1)
Converting primitives to objects.
Definition of Wrapper Classes
Use cases of Wrapper Classes
Common mistakes in Wrapper Classes
28. Step-by-step working of Wrapper Classes
29. Best practices for Wrapper Classes
30. Real-world application of Wrapper Classes
// Example for Wrapper Classes
public class Example {
public static void main(String[] args) {
[Link]("Wrapper Classes example");
}
}
Classes and Objects (Part 2)
Basic building blocks of Java.
Definition of Classes and Objects
Use cases of Classes and Objects
Common mistakes in Classes and Objects
31. Step-by-step working of Classes and Objects
32. Best practices for Classes and Objects
33. Real-world application of Classes and Objects
// Example for Classes and Objects
public class Example {
public static void main(String[] args) {
[Link]("Classes and Objects example");
}
}
Encapsulation (Part 2)
Data hiding using access modifiers.
Definition of Encapsulation
Use cases of Encapsulation
Common mistakes in Encapsulation
34. Step-by-step working of Encapsulation
35. Best practices for Encapsulation
36. Real-world application of Encapsulation
// Example for Encapsulation
public class Example {
public static void main(String[] args) {
[Link]("Encapsulation example");
}
}
Inheritance (Part 2)
Reusing code via extends.
Definition of Inheritance
Use cases of Inheritance
Common mistakes in Inheritance
37. Step-by-step working of Inheritance
38. Best practices for Inheritance
39. Real-world application of Inheritance
// Example for Inheritance
public class Example {
public static void main(String[] args) {
[Link]("Inheritance example");
}
}
Polymorphism (Part 2)
Method overloading and overriding.
Definition of Polymorphism
Use cases of Polymorphism
Common mistakes in Polymorphism
40. Step-by-step working of Polymorphism
41. Best practices for Polymorphism
42. Real-world application of Polymorphism
// Example for Polymorphism
public class Example {
public static void main(String[] args) {
[Link]("Polymorphism example");
}
}
Abstraction (Part 2)
Abstract classes and interfaces.
Definition of Abstraction
Use cases of Abstraction
Common mistakes in Abstraction
43. Step-by-step working of Abstraction
44. Best practices for Abstraction
45. Real-world application of Abstraction
// Example for Abstraction
public class Example {
public static void main(String[] args) {
[Link]("Abstraction example");
}
}
Interfaces (Part 2)
Pure abstraction.
Definition of Interfaces
Use cases of Interfaces
Common mistakes in Interfaces
46. Step-by-step working of Interfaces
47. Best practices for Interfaces
48. Real-world application of Interfaces
// Example for Interfaces
public class Example {
public static void main(String[] args) {
[Link]("Interfaces example");
}
}
Access Modifiers (Part 2)
public, private, protected.
Definition of Access Modifiers
Use cases of Access Modifiers
Common mistakes in Access Modifiers
49. Step-by-step working of Access Modifiers
50. Best practices for Access Modifiers
51. Real-world application of Access Modifiers
// Example for Access Modifiers
public class Example {
public static void main(String[] args) {
[Link]("Access Modifiers example");
}
}
this and super (Part 2)
Keywords usage.
Definition of this and super
Use cases of this and super
Common mistakes in this and super
52. Step-by-step working of this and super
53. Best practices for this and super
54. Real-world application of this and super
// Example for this and super
public class Example {
public static void main(String[] args) {
[Link]("this and super example");
}
}
Object Class (Part 2)
Root class of Java.
Definition of Object Class
Use cases of Object Class
Common mistakes in Object Class
55. Step-by-step working of Object Class
56. Best practices for Object Class
57. Real-world application of Object Class
// Example for Object Class
public class Example {
public static void main(String[] args) {
[Link]("Object Class example");
}
}
Wrapper Classes (Part 2)
Converting primitives to objects.
Definition of Wrapper Classes
Use cases of Wrapper Classes
Common mistakes in Wrapper Classes
58. Step-by-step working of Wrapper Classes
59. Best practices for Wrapper Classes
60. Real-world application of Wrapper Classes
// Example for Wrapper Classes
public class Example {
public static void main(String[] args) {
[Link]("Wrapper Classes example");
}
}
Classes and Objects (Part 3)
Basic building blocks of Java.
Definition of Classes and Objects
Use cases of Classes and Objects
Common mistakes in Classes and Objects
61. Step-by-step working of Classes and Objects
62. Best practices for Classes and Objects
63. Real-world application of Classes and Objects
// Example for Classes and Objects
public class Example {
public static void main(String[] args) {
[Link]("Classes and Objects example");
}
}
Encapsulation (Part 3)
Data hiding using access modifiers.
Definition of Encapsulation
Use cases of Encapsulation
Common mistakes in Encapsulation
64. Step-by-step working of Encapsulation
65. Best practices for Encapsulation
66. Real-world application of Encapsulation
// Example for Encapsulation
public class Example {
public static void main(String[] args) {
[Link]("Encapsulation example");
}
}
Inheritance (Part 3)
Reusing code via extends.
Definition of Inheritance
Use cases of Inheritance
Common mistakes in Inheritance
67. Step-by-step working of Inheritance
68. Best practices for Inheritance
69. Real-world application of Inheritance
// Example for Inheritance
public class Example {
public static void main(String[] args) {
[Link]("Inheritance example");
}
}
Polymorphism (Part 3)
Method overloading and overriding.
Definition of Polymorphism
Use cases of Polymorphism
Common mistakes in Polymorphism
70. Step-by-step working of Polymorphism
71. Best practices for Polymorphism
72. Real-world application of Polymorphism
// Example for Polymorphism
public class Example {
public static void main(String[] args) {
[Link]("Polymorphism example");
}
}
Abstraction (Part 3)
Abstract classes and interfaces.
Definition of Abstraction
Use cases of Abstraction
Common mistakes in Abstraction
73. Step-by-step working of Abstraction
74. Best practices for Abstraction
75. Real-world application of Abstraction
// Example for Abstraction
public class Example {
public static void main(String[] args) {
[Link]("Abstraction example");
}
}
Interfaces (Part 3)
Pure abstraction.
Definition of Interfaces
Use cases of Interfaces
Common mistakes in Interfaces
76. Step-by-step working of Interfaces
77. Best practices for Interfaces
78. Real-world application of Interfaces
// Example for Interfaces
public class Example {
public static void main(String[] args) {
[Link]("Interfaces example");
}
}
Access Modifiers (Part 3)
public, private, protected.
Definition of Access Modifiers
Use cases of Access Modifiers
Common mistakes in Access Modifiers
79. Step-by-step working of Access Modifiers
80. Best practices for Access Modifiers
81. Real-world application of Access Modifiers
// Example for Access Modifiers
public class Example {
public static void main(String[] args) {
[Link]("Access Modifiers example");
}
}
this and super (Part 3)
Keywords usage.
Definition of this and super
Use cases of this and super
Common mistakes in this and super
82. Step-by-step working of this and super
83. Best practices for this and super
84. Real-world application of this and super
// Example for this and super
public class Example {
public static void main(String[] args) {
[Link]("this and super example");
}
}
Object Class (Part 3)
Root class of Java.
Definition of Object Class
Use cases of Object Class
Common mistakes in Object Class
85. Step-by-step working of Object Class
86. Best practices for Object Class
87. Real-world application of Object Class
// Example for Object Class
public class Example {
public static void main(String[] args) {
[Link]("Object Class example");
}
}
Wrapper Classes (Part 3)
Converting primitives to objects.
Definition of Wrapper Classes
Use cases of Wrapper Classes
Common mistakes in Wrapper Classes
88. Step-by-step working of Wrapper Classes
89. Best practices for Wrapper Classes
90. Real-world application of Wrapper Classes
// Example for Wrapper Classes
public class Example {
public static void main(String[] args) {
[Link]("Wrapper Classes example");
}
}