Saturday, 16 March 2013

What is an Object and how do you allocate memory to it?


What is an Object and how do you allocate memory to it?
Object is an instance of a class and it is a software unit that combines a structured set of data with a set of operations for inspecting and manipulating that data. An object is created using new operator, memory is allocated to it.

Blog Author: Vijay Kumar



What is the difference between constructor and method?


What is the difference between constructor and method?
Constructor will be automatically invoked when an object is created whereas method has to be called explicitly.

Blog Author: Vijay Kumar



What are methods and how are they defined?


What are methods and how are they defined?
 -  Methods are functions that operate on instances of classes in which they are defined. Objects can communicate with each other using methods and can call methods in other classes. Method definition has four parts. They are name of the method, type of object or primitive type the method returns, a list of parameters and the body of the method. A method’s signature is a combination of the first three parts mentioned above.

Blog Author: Vijay Kumar



What is the use of bin and lib in JDK?


What is the use of bin and lib in JDK?
 -  Bin contains all tools such as javac, appletviewer, awt tool, etc., whereas lib contains API and all packages.

Blog Author: Vijay Kumar



What is casting?


What is casting?
 -  Casting is used to convert the value of one type to another.

Blog Author: Vijay Kumar