JAVA, Programmimg Languages

How to create new Objects in Java

In Java, we can create new objects of a class by using new operator. The new operator creates an instance of a class and returns the reference of the new object.

For ex-

Movie mov = new Movie();

This statement creates an instance variable of the Movie type named mov.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s