Sunday, 6 July 2014

Constructors in Java



Signature differences

Constructors and methods differ in three aspects of the signature: modifiers, return type, and name. Like methods, constructors can have any of the access modifiers: public, protected, private, or none (often called package or friendly). Unlike methods, constructors can take only access modifiers. Therefore, constructors cannot be abstractfinalnativestatic, or synchronized.
The return types are very different too. Methods can have any valid return type, or no return type, in which case the return type is given as void. Constructors have no return type, not even void.

Wednesday, 2 July 2014

Java Memory Management

Java Memory Management


Garbage Collection:


Garbage collection (GC) is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program.




Source:-
http://javadecodedquestions.blogspot.in/2012/12/java-memory-management.html