Array Manipulation

Array is a finite collection of similar datatype arranged in a adjacent manner. Array Syntax Method – 1 datatype arrayname[]=new datatype[size];  Method – 2 datatype arrayname[]; arrayname=new datatype[size]; Method – 3 datatype arrayname[]= {value1,vlaue2,…}; The following java program gets n numbers as inputs and prints the n numbers as output using array.

Read More

Static Properties and Methods

Static Properties 1.It will be created commonly only once for all objects. 2.It will be initialized only once when the first object is created , further initialization is not permitted. 3.It is visible within the class but lifetime is throughout the program. Static Methods 1.It can access only static members. 2.It can be invoked using…

Read More

Usage of ‘this’ keyword in java

It always holds the reference of the current object.It can be used in the following situations 1.this can be used to refer current class instance variable. 2.this can be used to invoke current class method (implicitly). 3.this() can be used to invoke current class constructor. 4.this can be passed as an argument in the method…

Read More