When the Java interpreter needs to use a definition of the HelloObject class, where will it be found?

A good answer might be:

In the file of bytecodes, HelloObject.class.

Steps in Running the Program

Here is how the program runs. (Remember that it is actually the bytecodes that run. However it is convenient to temporarily pretend that the statements of the source program run one after another, starting in main().)

class HelloObject                                 // 2a.  The class definition is
{                                                 //      used to make the object

  void speak()                                    // 2b.  A speak() method
  {                                               //      is included in the object.


    System.out.println("Hello from an object!");  // 3a.  The speak() method
                                                  //      of the object prints on the
                                                  //      screen.

                                                  // 3b.  The method returns to the
                                                  //      caller.
  }
}

class HelloTester
{
  public static void main ( String[] args )       // 1.  Main starts running.
  {
    HelloObject anObject = new HelloObject();     // 2.  A HelloObject 
                                                  //     is created.

    anObject.speak();                             // 3.  The object's speak() 
                                                  //     method is called.

  }                                               // 4.  The entire program is finished.
}

QUESTION 11:

Could you activate the speak() method without creating an object?

Click Here after you have answered the question