Explain what occur when an object is created in java, JAVA Programming

Assignment Help:

Explain what occur when an object is created in Java?


Related Discussions:- Explain what occur when an object is created in java

How to construct objects with new operator, How to Construct objects with n...

How to Construct objects with new operator? class Car { String licensePlate; // e.g. "New York 543 A23" double speed; // in kilometers per hour double maxSpeed;

What is action class, The Action Class is type of the Model and is a wrappe...

The Action Class is type of the Model and is a wrapper around the business logic. The purpose of Action Class is to change the HttpServletRequest to the business logic. To use the

Authorization-security compnent, Define : Authorization is the process by ...

Define : Authorization is the process by which a program calculates whether a given identity is permitted to access a source such as an application component or a file. Now that y

Difference between the file and randomaccessfile classes, The File class en...

The File class encapsulates the files and directories of the local file system. The RandomAccessFile class gives the methods required to directly access data contained in any part

Stream as an object, What interface must an object implement before it can ...

What interface must an object implement before it can be written to a stream as an object?      Ans) An object must execute the Serializable or Externalizable interface before i

Socket programming in Java: TCP, Objectives: socket programming in Java: TC...

Objectives: socket programming in Java: TCP Exercises: Goal: In this project we will develop a Web server in two steps. In the end, you will have built a multi-threaded Web ser

I want school management project, I want School Management project Proje...

I want School Management project Project Description: An easy school management project which able to store all data about students like fees structure, admission details and

Describe inner classes in java, Describe Inner Classes in java? An inne...

Describe Inner Classes in java? An inner class is a class whose body is described inside another class, referred to as the top-level class. For instance: public class Queue {

12/3/2013 1:36:08 AM

Several things occur in a particular order to ensure an object is constructed properly:

1. Memory is allocated from heap to hold all instance variables and implementation specific data of an object and its super classes. An Implementation specific data includes pointers to class and method data.

2. An instance variables of the objects are initialized to their default values.

3. A constructor for the most derived class is invoked. The first thing a constructor does is call constructors for its super classes. This process continues until a constructor for java.lang. Object is known 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 initializes and initialization blocks are executed. Then the body of a constructor is executed. Thus, constructor for the base class completes first and constructor for the most derived class completes last.

 

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd