Skip to content

Commit 7abd08e

Browse files
Merge branch 'kunal-kushwaha:main' into abhiraj
2 parents a15428f + 45794cb commit 7abd08e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lectures/17-oop/notes/classes.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The key to Java’s safety is that you cannot manipulate references as you can a
2626
Thus, you cannot cause an object reference to point to an arbitrary memory location or manipulate it like an integer.
2727

2828
A Closer Look at new:
29-
class-var = new classname ( );
29+
classname class-var = new classname ( );
3030
Here, class-var is a variable of the class type being created. The classname is the name of the class that is being
3131
instantiated. The class name followed by parentheses specifies the constructor for the class. A constructor defines
3232
what occurs when an object of a class is created.
@@ -55,4 +55,4 @@ For example, square(100) passes 100 as an argument. Inside square( ), the parame
5555

5656
NOTE:
5757
Bus bus = new Bus();
58-
lhs(reference i.e. bus) is looked be compiler & rhs (object i.e. new Bus()) is looked by jvm
58+
lhs(reference i.e. bus) is looked be compiler & rhs (object i.e. new Bus()) is looked by jvm

0 commit comments

Comments
 (0)