Skip to content

Commit a5ad584

Browse files
committed
Minor changes
1 parent 2eceaa2 commit a5ad584

3 files changed

Lines changed: 10 additions & 3 deletions

File tree

java/control-statements/loops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class ForExample {
2525

2626
## While
2727

28-
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of ierations is not known in advance.
28+
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations is not known in advance.
2929

3030
### Syntax
3131

java/oops/classes-and-objects.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ Object Oriented programming is a methodology based on objects instead of functio
1010

1111
## 1. Classes and objects
1212

13-
Object is a basic unit in OOP, and is an instance of the class. They have state and behaviour. Consider mobile as an object and let's see an example to understand state and behaviour. State of the objects can be represented by variables and behaviour of the objects can be represented by methods. Object is a real-world or run-time entity.
13+
Object is a basic unit in OOP, and is an instance of the class. They have state and behaviour. Consider mobile as an object and let's see an example to understand state and behaviour.
14+
15+
State of the objects can be represented by variables and behaviour of the objects can be represented by methods. Object is a real-world or run-time entity.
1416

1517
**Object** : Mobile
1618
**State** : Model, Brand, Color, Size

java/oops/inheritance.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
Inheritance is a process of acquiring parent properties and behaviour by a child automatically. Hence you can either reuse or extend parent properties or behaviour in the child class. The main advantage of inheritance is code reusability. Use the keyword `extends` to inherit from a class.
22

33
### Type of Inheritance
4+
45
* Single inheritance
6+
57
When a child inherits properties from a single parent
68

79
* Multiple inheritance
10+
811
When a child inherits its properties from two or more parents.
912

1013
* Hierarchical inheritance
14+
1115
When multiple children inherit properties from a parent
1216

1317
* Multilevel inheritance
18+
1419
When a parent properties are inherited by a child which again get interited by another child. For example, B is inherited from A and C is inherited from B.
1520

1621
A -> B -> C
1722
* Hybrid inheritance
18-
Hybrid inheritance is a combination or two or more inheritance types.
1923

24+
Hybrid inheritance is a combination or two or more inheritance types.
2025

2126
Below is an example of single inheritance
2227

0 commit comments

Comments
 (0)