


Java supports variable length argument of one data type. That is we don't need to define number of arguments when its variable for one type of data-type. For example:- class Calculator { public int sum (int... a) { int total=0; for(int i=0; i < a.length; i++) total+= a[i]; return total; } } A variab...
Posted on 21 December 2014 | 11:18 am
Read postConstructors are special methods that are called automatically when an object of the class is created. Constructor have same name as the class and they dont have a return type not even void. Basically there are 3 types of constructors Default Parameterized Copy-constructor Default Constructor:- This...
Posted on 20 December 2014 | 4:44 pm
Read post'this' is a reference variable that refers to the object that has called the member function. 'this' is available in all methods of a class except static methods. It is created implicitly so we don't need to declare it. class Money { private int rs, paisa; public void set (int rs, int paisa) { this.
Posted on 20 December 2014 | 4:01 pm
Read post