⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 verifiertest.java

📁 这是高级Java里面的源代码
💻 JAVA
字号:
/**
   @version 1.00 1997-09-10
   @author Cay Horstmann
*/

import java.awt.*;
import java.applet.*;

/**
   This application demonstrates the bytecode verifier of
   the virtual machine. If you use a hex editor to modify the
   class file, then the virtual machine should detect the
   tampering.
*/
public class VerifierTest extends Applet
{  
   public static void main(String[] args)
   {  
      System.out.println("1 + 2 == " + fun());
   }

   /**
      A function that computes 1 + 2
      @return 3, if the code has not been corrupted
   */
   public static int fun()
   {  
      int m;
      int n;
      m = 1;
      n = 2;
      // use hex editor to change to "m = 2" in class file
      int r = m + n;
      return r;
   }

   public void paint(Graphics g)
   {  
      g.drawString("1 + 2 == " + fun(), 20, 20);
   }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -