So that's the end of the second chapter through this chapter. 2
We got started with the Java Language basics. 3
We have taken a top down approach in learning the concepts that is we first introduced a concept of 4
object oriented programming by explaining what classes and objects are. 5
We studied variables methods and constructors in detail which are the chord building blocks of a class 6
. 7
We also did our first date structure of course which is an array. 8
Now let's just look at some of the important points we covered in this chapter. 9
We started with looking at object oriented programming which helps model real world scenarios in a more 10
natural way. 11
Angela An object is used to represent a real world and to be like a student and objects are defined 12
using a class that is Classes like a blueprint and objects are instances of a class. 13
Next we look at variables. 14
A variable is simply a container that holds something and the type of data that a variable can hold 15
is defined as the variable creation by which set off by stating the variables type. 16
So once a variable type is defined it can only hold data of that particular type and it cannot hold 17
any other type of data. 18
And due to this is refer to as it is tactically type language it variable's type can be either a primitive 19
type audit class name and we saw that in Java how eight primitive better days. 20
And we also saw that there are three kinds of variables instance Dodik and local variables instance 21
variables are unique to each object and they Hallen object stayed static with it was a class variables 22
that are shared across all objects of the class. 23
Finally local variables are defined within methods are constructors even method parameters and constructor 24
parameters are considered as local variables. 25
When X look that address in Java an array is an object that is it gets stored on the heap like any other 26
regular Java object. 27
And it is used to store a fixed number of elements of a single type and that type can be either promote 28
do or object reference or support fast random access and by fast here we mean constant time. 29
So accessing 1000th element would pick the same amount of time as accessing the Fifth Element relex 30
look at methods which basically represent behavior and Jawa always uses pass by value mechanism while 31
passing data methods even for object references. 32
We know that it passes a copy of the memory address of the object within that method overloading word 33
within the same class. 34
We can have multiple methods with the same name but different parameterless to be considered a valid 35
overload method parameters must be different. 36
Finally we look at constructors a concept that is invoked when an object is being created and it is 37
typically used to initialize object state and we can have multiple ganster person in the same class 38
. 39
And this invocation statement is used to invoke an overloaded constructor and disintegrations statement 40
must also be the first statement in that constructor and that's about it. 41
Thanks for listening and we will continue learning more language basics in the next chapter.