package mymy.example08;
public class Product {
int productNo;
double price;
}
package mymy.example08;
import mymy.example08.Product;
public class ProductTest {
public static void main(String[] args){
Product iphone7=new Product();
System.out.println("商品的编号:"+iphone7.productNo);
System.out.println("商品的单价:"+iphone7.price);
iphone7.productNo=123456;
iphone7.price=6777;
System.out.println("商品的编号:"+iphone7.productNo);
System.out.println("商品的单价:"+iphone7.price);
}
}
"C:\Program Files\Java\jdk-15.0.2\bin\java.exe" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2020.1.3\lib\idea_rt.jar=62300:C:\Program Files\JetBrains\IntelliJ IDEA 2020.1.3\bin" -Dfile.encoding=UTF-8 -classpath C:\Users\橙子\IdeaProjects\helloweb\out\production\helloweb mymy.example08.ProductTest
商品的编号:0
商品的单价:0.0
商品的编号:123456
商品的单价:6777.0
Process finished with exit code 0