返回列表 發帖
  1. public class Student {
  2.         public String name;
  3.         public int score;
  4.         Student(String n, int s)
  5.         {
  6.                 name=n;
  7.                 score=s;
  8.         }
  9.         public String getName()
  10.         {
  11.                 return name;
  12.         }
  13.         public void setScore(int s)
  14.         {
  15.                 score=s;
  16.         }
  17.          public static void helloWorld()
  18.          {
  19.          System.out.println("Hello World!!!");
  20.      }
  21. }package Asdf;

  22. public class test {
  23.         public static void main(String[] args)
  24.         {
  25.                   Student Sam = new Student("Sam", 59);                        
  26.           Student Ray = new Student("Ray", 95);
  27.           Student.helloWorld();
  28.         }
  29. }
複製代碼
我是眾神之王XXX  I love you
0000000000

TOP

返回列表