Розмір відео: 1280 X 720853 X 480640 X 360
Показувати елементи керування програвачем
Автоматичне відтворення
Автоповтор
"oh printf... everyones favorite.." that cracked me up man... it's the little things!
Thanks this is a huge help.
ice! its actually worked!!!!! 😘
does the csv file clears itself after every run?
How to avoid converting String value '14E02' to exponential format in CSV
How would you write an entire object without calling each child?
nice, what keyboard are you using ?
Red Dragon with blue switches
Guess who got picked up by UA-cam algorithms
You sound like dvr =:)
Export:public void save(String filename) throws IOException {File file = new File(filename);try (PrintWriter zapis = new PrintWriter(file)) {for (Produkt produkt : produktList) {zapis.println(produkt.getName() + ";"+ produkt.getWeight() + ";"+ produkt.getUnitPrice() + ";"+ produkt.getQuantity());}System.out.println("Zapis się powiódł!");}catch (IOException ex) {throw ex;}}System.out.print("Enter file path to save: ");scanner.nextLine();String filename = scanner.nextLine();shoppingList.save(filename);System.out.println("Saved successfully.");import:public List importData(String filename) throws IOException {List importedList = new ArrayList();File file = new File(filename);if (file.exists() && file.canRead()) {try (Scanner scn = new Scanner(file);) {while (scn.hasNext()) {String zdanie = scn.nextLine();String[] parts = zdanie.split(";");if (parts.length == 4) {String name = parts[0];int weight = Integer.parseInt(parts[1]);double unitPrice = Double.parseDouble(parts[2]);int quantity = Integer.parseInt(parts[3]);Produkt produkt = new Produkt(name, weight, unitPrice, quantity);produktList.add(produkt);}}}catch (IOException ex) {throw ex;}}return importedList;}System.out.print("Enter file path to import: ");scanner.nextLine();String filePath = scanner.nextLine();shoppingList.importData(filePath);System.out.println("Imported successfully.");
"oh printf... everyones favorite.." that cracked me up man... it's the little things!
Thanks this is a huge help.
ice! its actually worked!!!!! 😘
does the csv file clears itself after every run?
How to avoid converting String value '14E02' to exponential format in CSV
How would you write an entire object without calling each child?
nice, what keyboard are you using ?
Red Dragon with blue switches
Guess who got picked up by UA-cam algorithms
You sound like dvr =:)
Export:
public void save(String filename) throws IOException {
File file = new File(filename);
try (PrintWriter zapis = new PrintWriter(file)) {
for (Produkt produkt : produktList) {
zapis.println(produkt.getName() + ";"
+ produkt.getWeight() + ";"
+ produkt.getUnitPrice() + ";"
+ produkt.getQuantity());
}
System.out.println("Zapis się powiódł!");
}
catch (IOException ex) {
throw ex;
}
}
System.out.print("Enter file path to save: ");
scanner.nextLine();
String filename = scanner.nextLine();
shoppingList.save(filename);
System.out.println("Saved successfully.");
import:
public List importData(String filename) throws IOException {
List importedList = new ArrayList();
File file = new File(filename);
if (file.exists() && file.canRead()) {
try (Scanner scn = new Scanner(file);) {
while (scn.hasNext()) {
String zdanie = scn.nextLine();
String[] parts = zdanie.split(";");
if (parts.length == 4) {
String name = parts[0];
int weight = Integer.parseInt(parts[1]);
double unitPrice = Double.parseDouble(parts[2]);
int quantity = Integer.parseInt(parts[3]);
Produkt produkt = new Produkt(name, weight, unitPrice, quantity);
produktList.add(produkt);
}
}
}
catch (IOException ex) {
throw ex;
}
}
return importedList;
}
System.out.print("Enter file path to import: ");
scanner.nextLine();
String filePath = scanner.nextLine();
shoppingList.importData(filePath);
System.out.println("Imported successfully.");