-2
如何添加解析字符串并获取存储在字符串中的三个字段的代码?解析字符串
我必须:在Main类中,添加解析字符串并获取存储在字符串中的三个字段的代码。然后,将这些数据存储在Product对象中。
我到目前为止的代码是:
package murach.ui;
import murach.business.Product;
public class Main {
public static void main(String[] args) {
String javaProduct = " ";
//TODO: process productString and populate fields of product object
System.out.println("Code: " + product.getCode());
System.out.println("Description: " + product.getDescription());
System.out.println("Price: " + product.getPriceFormatted());
}
}
什么是产品代码? –
对不起,我是编程新手。我认为它是Product product = new Product(); – user8666554
嗯什么是产品vs javaProduct?这是你的实际编译代码吗?还是你只是在这里写在这里?你试图达到什么样的结果? – Girauder