public class Fangfafanhuizhi { int giveSecret(){ return 42; } public static void main(String[] args){ Fangfafanhuizhi life = new Fangfafanhuizhi(); int x = 0; System.out.println("赋值之前的X值="+x); x = life.giveSecret(); System.out.println("赋值之后的x值="+x); } }