Posts

Showing posts from February, 2012

Java interview questions and answers

Describe what happens when an object is created in Java? Several things happen in a particular order to ensure the object is constructed properly: 1. Memory is allocated from heap to hold all instance variables and implementation-specific data of the object and its superclasses. Implementation-specific data includes pointers to class and method data. 2. The instance variables of the objects are initialized to their default values. 3. The constructor for the most derived class is invoked. The first thing a constructor does is call the constructor for its uppercase. This process continues until the constructor for java.lang.Object is called, as java.lang.Object is the base class for all objects in java. 4. Before the body of the constructor is executed, all instance variable initializers and initialization blocks are executed. Then the body of the constructor is executed. Thus, the constructor for the base class completes first and constructor for the most derived class completes l

C Interview Link

Image
Question Rating View Answer What does it mean when a pointer is used in an if statement? View Answer When would you use a pointer to a function? View Answer Why should we assign NULL to the elements (pointer) after freeing them? View Answer What is file pointer and its working method? View Answer What is indirection? View Answer Following declarations are same const char *s; char const *s; View Answer Difference between :- 1) NULL pointer and NULL macro ? View Answer What is the difference between far and near? View Answer WRITE A C PROGRAMME TO FIND OUT THE AREA OF A CIRCLE USING POINTER. View Answer Why should we assign NULL to the elements (pointer) after freeing them ? View Answer In the following code, what is p2? typedef int* ptr ptr p1, p2; View Answer What do you mean by normalisation of pointers View Answer Difference between arrays and pointers? View Answer Between a long pointer and a char pointer , which one consumes more memo