Skip to content

Commit 1624cbf

Browse files
authored
Update README.md
1 parent 21ccaa2 commit 1624cbf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Singleton pattern is used when you need only one instance of some class for the hole program.
66

7-
For example, let's say we have a class Spaceshipt with the attributes:
7+
For example, let's say we have a class Starship with the attributes:
88

99
- Name
1010
- Lenght
@@ -15,6 +15,6 @@ For example, let's say we have a class Spaceshipt with the attributes:
1515

1616
Imagine that the navigation team wants to land the ship into a new planet, but for some mistake an intern created another instance of the ship to play with. Somehow, the navigation team got the wrong instance of the ship, and the landing calculations where all messed up and the spaceship crashed against the planet.
1717

18-
To avoid disasters like this, we would want every crew member in the Spaceship to have access to the same information, with no more than one instance of the Spaceship.
18+
To avoid disasters like this, we would want every crew member in the Starship to have access to the same information, with no more than one instance of the Starship.
1919

20-
Singleton pattern solves this problem, where the class constructor is private, meaning that no one can implement a new instance of the class except for itself. The class attributes belongs to the class, so they are static.
20+
Singleton pattern solves this problem, where the class constructor is private, meaning that no one can implement a new instance of the class except for itself. The class attributes belongs to the class, so they are static.

0 commit comments

Comments
 (0)