Computer Science, asked by ZYXW999, 8 months ago

Please Explain.....Write a Java statement to create an object Mango of class fruits.​

Answers

Answered by KailashHarjo
0

A Java statement to create an object Mango of class fruits is:

Fruit Mango=new fruit();

  • An OOPs language's fundamental building block is the object. No Java program can be run without first creating an object. In Java, there are several ways to create an object.
  • The most common method for producing an object or instance of the class is to use the new keyword. When we use the new keyword to create an instance of a class, memory (heap) is allocated for the newly created object, and a reference to that object's memory is also returned. The creation of an array also uses the new keyword. The object creation syntax is:
  • ClassName object = new ClassName();
  • Here, the class is identified as Fruits, and the object is identified as a Mango.

To learn more:

https://brainly.in/question/16040398

https://brainly.in/question/4231011

#SPJ2

Similar questions
Math, 1 year ago