Question
Describe what happens when an object is created in java?

Answers

Several things happen in a particular order to ensure the object is constructed properly:

1. Memory allocation: To hold all instance variables and implementation-specific data of the object and its super classes.

2. Initialization: the objects are initialized to their default values.

3. Constructor: Constructors call the constructors for its super classes. 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. Execution: Before the body of the constructor is executed all instance variable initializes and initialization blocks must get executed. Then the body of the constructor is executed.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q What is the need of depreciation account?
  • Q What functions does a data dictionary perform?
  • Q The most straightforward and minimum dirtying method for inferring vitality is
  • Q How do you keep parents informed of their childs' progress?
  • Q What is an exception Object
  • Q Explain the relationship between silverlight and windows media technologies?
  • Q What are the different residential statuses applicable in the usa?
  • Q Which is a UNESCO world heritage site
  • Q Explain the difference between rpc and rmi?
  • Q What is Response object? How is it related to ASP's Response object?
  • Q What is a namespace in mongodb?