深入淺出JAVA-第一個物件程式(P37)

深入淺出JAVA-第一個物件程式(P37)

類別class

Class Movie{
string Name;
string Type;
int rating;

void PlayIt(){
    System.out.printIn("playing the movie")
    }
}

測試類別

public class MovieTestDrive{
    public static void main(string[] args{
Movie One = New Movie();
one Name ="Starwars"
one Type ="Tech"
ont rating ="8"
Movie Two = New Movie();
two Name ="Revengers"
two Type ="Hero"
two rating="5"
Movie Three = New Movie();
Three Name ="SpiderMan"
Three Type ="Hero"
Three rating="9"
}
}

Comments

Popular posts from this blog

MEGA 暫存檔案刪除

XAMPP 使用多PORT來執行不同網頁

IOS GCD多執行緒