Compiled language written by the program before the execution, need a special compilation process, the program compiled into machine language files, such as EXE files, later to run without re-translation, directly using the results of the compilation (EXE file), because the translation is done only once, the runtime does not need to translate, Therefore, the program execution efficiency of the compiled language is high.
1 Packagecom.table;2 3 4 classPenson5 {6 protectedString name;7 protectedString addr;8 protectedString sex;9 protected intAge ;Ten One PublicString GetName () { A returnname; - } - the Public voidsetName (String name) { - This. Name =name; - } - + PublicString getaddr () { - returnaddr; + } A at Public voidsetaddr (String addr) { - This. addr =addr; - } - - PublicString Getsex () { - returnsex; in } - to Public voidsetsex (String sex) { + This. Sex =sex; - } the * Public intGetage () { $ returnAge ;Panax Notoginseng } - the Public voidSetage (intAge ) { + This. Age =Age ; A } the + voidShowitems () - { $System.out.println ("Name:" +GetName () $+ "Address:" +getaddr () -+ "Gender:" +Getsex () -+ "Age:" +getage ()); the } - }Wuyi the classStudentextendsPenson - { Wu intMathscore; - intEnglishscore; About $ PublicStudent (string name, String addr, String sex,intAgeintMathscore,intEnglishscore) { - This. Mathscore =Mathscore; - This. Englishscore =Englishscore; - This. Name =name; A This. addr =addr; + This. Sex =sex; the This. Age =Age ; - } $ the voidShowitems () the { theSystem.out.println ("Name:" +GetName () the+ "Address:" +getaddr () -+ "Gender:" +Getsex () in+ "Age:" +getage () the+ "Math Score:" +Mathscore the+ "English score:" +englishscore); About } the } the Public classfourteentable { the Public Static voidMain (String []args) + { -Student stu =NewStudent ("Borter", "Beijing", "Boy", 22, 80, 90); the Stu. Showitems ();Bayi } the } the
High efficiency of program execution in compiled languages