运行 ❯
获取您自己的
Java 服务器
×
更改方向
更改主题,深色/浅色
前往 Spaces
Main.java
Second.java
public class Main { public String fname = "John"; public String lname = "Doe"; public String email = "john@doe.com"; public int age = 24; }
class Second { public static void main(String[] args) { Main myObj = new Main(); System.out.println("Name: " + myObj.fname + " " + myObj.lname); System.out.println("Email: " + myObj.email); System.out.println("Age: " + myObj.age); } }
姓名: John Doe
电子邮件:
[email protected]
年龄: 24