标签:java pre return main ack vat idt str sys
7.1
package pra; public class Pra1 { private String name; public String out() { return name; } public void input(String name) { this.name=name; } public static void main(String[] args) { Pra1 heav=new Pra1(); heav.input("Chari"); System.out.println(heav.out()); } }
7.2
package pra; public class Pra1 { private double length; private double width; public Pra1(double length,double width){ this.length=length; this.width=width; } public double product() { return length*width; } public static void main(String[] args) { Pra1 rec=new Pra1(55.5,65.5); System.out.println(rec.product()); } }
7.3
package pra; public class Pra1 { public static void main(String[] args) { int i; for(i=0;i<args.length;i++) { System.out.println(i); } } }
标签:java pre return main ack vat idt str sys
原文地址:https://www.cnblogs.com/comicfuji/p/9532197.html