5.調用類greeting的構造函數greeting()將greeting實例化為hello.
6.然後調用greet()方法.

解决方案 »

  1.   

    5 新建一个greeting
    6 调用greeting的greet()方法
      

  2.   

    第5行:
    1、分配一段内存区给hello引用;
    2、new关键字初始化一段greeting内存空间给实例hello使用;
    3、调用greeting的无参构造器。
    第6行:
    实例hello调用greeting类的方法
      

  3.   

    程序不止这么些吧
    这么写你应该能看明白1 class  testgreeting
    2 {
    3 public static void main(String[] args) 
    4 {
    5 greeting hello =new greeting();//生成一个greet类的对象
    6 hello.greet();//调用greet方法
    7
    8 }
    9 }
    class greeting
    {
    public greeting()
     {
       //构造函数代码 
     }   
    public greet()
     {
       //一个方法
      System.out.println("Hello");
     } }
      

  4.   

    5 greeting hello =new greeting();//生成一个greet类的对象这句话里头哪有greet  怎么能生成greet类对象
      

  5.   

    tommy 我叭叭抽你
    啃了几天书本nb了