Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Describe Object in table below: Class Objects Other Objects Used in Java 1 3 2 4

ID: 3579783 • Letter: D

Question

Describe Object in table below:

Class Objects

Other Objects Used in Java

1

3

2

4

How are objects created in java, identify the keyword syntax.

>You create an object from a class. Objects have states and behaviors. And a class provides the blueprints for object.

There are three steps when creating an object from a class.

    Declaration - A variable declaration with a variable name with an object type.

    Instantiation - the "new" keyword is used to create the object.

    Initialization - the "new" keyword is followed by a call to a constructor. This call initializes the new object.

For example,

      public class Food {

                      public Food(String Country) {

                      // This constructor has one parameter, Country.

                                      System.out.println("My Favorite Food is: " + Country);

                      }

                      public static void main(String []args) {

                                      // Following statement would created an object myFood

                                      Food myFood = new Food ("Korean Food");

                      }

      }

As a result, the output will say-

Favorite Food is : Korean Food

Class Objects

Other Objects Used in Java

1

3

2

4

Explanation / Answer

class Object:

myFood -> which is the Food Object

Other java Objects.

Country -> which is the String object.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote