• 本地代码也可以与字节码区分开来


    本地代码也可以与字节码区分开来(有时候叫做编译代码),这种代码可以在 虚拟机上运行(比如JAVA虚拟机)。

    虚拟机是一个把通用字节码转换成用于特定处理器的本地代码的程序。微软的.NET 编译器产生的就是字节码(微软叫它作 中间语言)。

    Java字节码和微软的中间语言都能在执行前被即时编译器编译成高性能的本机代码。

     1 package Com.TableTest;
     2 
     3 class Movie{
     4     //实例对象
     5     String title;
     6     String genre;
     7     int rating;
     8     //方法
     9     void playIt(){
    10         System.out.println("Playing the movie"); 
    11         System.out.println(this.title);
    12         System.out.println(this.genre);
    13         System.out.println(this.rating);
    14     }
    15 }
    16 
    17 public class TableText_13 {
    18     //编写测试用的类
    19        public static void main(String[] args){
    20       //建立movie对象
    21       Movie one = new Movie();
    22       //圆点运算符引用
    23       one.title = "Gone with the Stock";
    24       one.genre = "Tragic";
    25       one.rating = -2;
    26       one.playIt();
    27       
    28       //建立movie对象
    29       Movie two = new Movie();
    30       two.title = "Lost in Cubicle Space";
    31       two.genre = "Comedy";
    32       two.rating = 5;
    33      //调用方法
    34       two.playIt();
    35       
    36        }
    37 }
  • 相关阅读:
    批处理学习笔记9
    批处理学习笔记8
    批处理学习笔记10
    批处理学习笔记7
    批处理学习笔记6
    批处理学习笔记系列
    批处理学习笔记5
    批处理学习笔记3
    批处理学习笔记4
    批处理学习笔记2
  • 原文地址:https://www.cnblogs.com/borter/p/9388500.html
Copyright © 2020-2023  润新知