Комментарии:
import java.util.*;
public class Main {
public static void main(String[] args) {
ArrayList<ArrayList<String>> groceryList = new ArrayList();
ArrayList<String> bakeryList = new ArrayList();
bakeryList.add("pasta");
bakeryList.add("garlic bread");
bakeryList.add("donuts");
ArrayList<String> produceList = new ArrayList();
produceList.add("tomatoes");
produceList.add("zucchini");
produceList.add("peppers");
ArrayList<String> drinksList = new ArrayList();
drinksList.add("soda");
drinksList.add("coffee");
groceryList.add(bakeryList);
groceryList.add(produceList);
groceryList.add(drinksList);
System.out.println(groceryList);
}
}
ArrayList<ArrayList<ArrayList<String>>> array = new ArrayList ();
Ответитьimport java.util.*;
public class Main {
public static void main(String[] args) {
ArrayList<ArrayList<String>> groceryList = new ArrayList();
ArrayList<String> bakeryList = new ArrayList();
bakeryList.add("pasta");
bakeryList.add("garlic bread");
bakeryList.add("donuts");
ArrayList<String> produceList = new ArrayList();
produceList.add("tomatoes");
produceList.add("zucchini");
produceList.add("peppers");
ArrayList<String> drinksList = new ArrayList();
drinksList.add("soda");
drinksList.add("coffee");
groceryList.add(bakeryList);
groceryList.add(produceList);
groceryList.add(drinksList);
System.out.println(groceryList);
}
}
it possible to populate array indexes with an array list?
ОтветитьYour code shows me all errors
Ответитьgm bro
ОтветитьSooo much fun to learn stuff from that one fellow Bro. 😍
ОтветитьAmazing. Do you have any task book for it and tasks for dynamic array as for 1 d so for 2d
ОтветитьThanks bro
Ответитьyoo brooo
Ответитьmy code which takes input from users ,package test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class Indra {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String cake;
String biscuit;
ArrayList<ArrayList<String>> grocery = new ArrayList<ArrayList<String>>();
ArrayList<String> cakes = new ArrayList<String>();
ArrayList<String> biscuits = new ArrayList<String>();
while (true) {
System.out.println("Enter cake name");
cake = input.nextLine();
if (cake.toLowerCase().equals("exit")) {
break;
} else {
cakes.add(cake);
}
}
while (true) {
System.out.println("Enter biscuit name");
biscuit = input.nextLine();
if (biscuit.toLowerCase().equals("exit")) {
break;
} else {
biscuits.add(biscuit);
}
}
input.close();
grocery.add(cakes);
grocery.add(biscuits);
System.out.println(grocery);
}
}
It helps
ОтветитьArrayList<>(); vs ArrayList<String>(); vs ArrayList(); What is the difference among them? I'm so confused.
Ответитьgg
ОтветитьClean & on point, thanks buddy.
ОтветитьYour channel is an absolute goldmine of information. Thanks brotha!
ОтветитьSystem.out.println(Ty Bro);
ОтветитьMy favorite channel!!
ОтветитьThank you for these easy, straight to the point videos 👍
ОтветитьIts very helpful for me thankyou , I love your clear and simple explanation
ОтветитьShort and sweet, thanks!
ОтветитьGenial!!
ОтветитьYou are a great teacher ❤❤
Ответитьvedio 20
Ответитьthx 4 vid bro !
ОтветитьOut standing 🧍♂️ 🙌 😎 💪 👌
ОтветитьThis is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
Ответить😀
Ответитьthanks! very helpful and well explained
ОтветитьI have a data in String as below:
String originalData = “[12345, 65656, abc, 7.5, 12/12/2023],[65656,abc,7.5,12/12/2020],[76767,565656,abc,7.5,12/12/2020]”;
I want to store the above in ArrayList<<ArrayList> >processedData();
Output:
processedData.get(0)= [12345, 65656, abc, 7.5, 12/12/2023] processedData.get(0).get(0)= 12345
Please help
quite informative with simple words
ОтветитьBro spring boot tutorial please 🙏 bro your explanation is super understandable bro
Ответитьthank you very much
Ответить🤘
ОтветитьGreat video and explanation
ОтветитьEZ and nice explanation bro... thanks..
Ответитьthanks
ОтветитьI always learn smth new! Thanks bro
ОтветитьThank you
Ответитьgreat Bro
Ответитьthank u bro
ОтветитьGg
ОтветитьBro спасибо
ОтветитьBro спасибо
Ответитьnothing but RESPECT for you fr
ОтветитьLove you man :')
ОтветитьThanks, Bro!
Ответить