arraylist

I can't implement List collection methods in JAVA

Encountered a problem when executing the task: I can't implement the methods of the List collection in accordance with the ta ... sk = Integer.parseInt(task); } else if (input.equals("end")) { for (String task : list) { } } }

Phone Directory, Add and Remove data to the Java array

I'm a newbie, the task is to write a phone directory, which has three functions: find, add, delete. I need to create an array ... PhoneNumber public void showFullName() { System.out.println(surname + " " + name1 + " " + patronymic); } }

Java identifier expected

A little confused. I have such constructors: public Circle() { this.center = new Point(0,0);//center.getX() this.inli ... (new Circle(new Point(0,0),new Point(5,5) )); shapes.add(new Circle()); shapes.add(); }

Implementing a dynamic array in Java

Please help me understand the topic of Java dynamic arrays. I need to create a class DynamicArray, which stores an array, a ... , one example of a dynamic array is ArrayList and you need to implement methods like it. Thank you in advance for your help!

How do I split a string into substrings?

I have a collection of ArrayList with a single string of more than 10000 + characters. [81383,892881,381818,54881,1283128... ... there are total elements. For the example of this sheet, I would like to get like this: 81383 892881 381818 54881 1283128

Determine which Java language keywords the file contains

I only googled contains, but for some reason it doesn't work.. apparently I'm doing something wrong keyWords - ArrayList< ... sortedList.add(g); counter++; } } }

List in list in list

There is a certain list - the gray squares are its elements. There can be N of them. Each element of this list can contain an ... неверно точка s2x1 стоит в точке s1x2 This is an addendum to this question: Parse the date and make a list of date range

Copying an ArrayList

There are ArrayList with values.Question: how can I completely copy an array value without loops? ArrayList a; ArrayList b; a = b;// Присвоить все значения b в этот массив.

Unity does not enter a permanent variable in the array

There is such a class public class Item : MonoBehaviour { [Header("Ссылка на префаб")] public string PrefabReferenc ... ......... Y: 2 X: 6 And after adding the {[9] element]} null Y: 0 X: 0 Y: 0 X: 1 Y: 0 X: 2 ......... ......... Y: 2 X: 6

Reading and Writing an Object Array List to a file

How to implement writing an object Array List to a file: txt or xml. Please explain this with specific examples. I'm doing a ... his instance. And whether the program will then correctly serialize my list with User objects, and not the empty list itself.

How do I initialize an ArrayList from a char array?

There is such a code: List<Character> charArray = new ArrayList<>(Arrays.asList(string.toCharArray())); But a ... List<Integer> charArray = new ArrayList<>(Arrays.asList(23,22,32)); UPD: Forgot to add without using a loop.

Redefining the add sheet methods

I can't override the add methods. Or rather, I can, but they don't work the way they should. The essence of the problem: We h ... le)); System.out.println(box.size()); } } When executing, we see: true true 2 And it should be: true false 1

Index returning -1 in Java ArrayList

Good Morning. For study purposes, I am making a simple application in RMI Java that simulates some operations(Create Account, ... executeMetodo(opcao); } } catch (Exception e) { e.printStackTrace(); } } }

Data does not persist in txt file

Good Morning, I have a question, I have this code, which is a contact schedule and the data should be persisted in a txt file ... printf("\nTelefone:%s\n",dados[1]); } } } }

Write and print data to an ArrayList

I am doing a college job and I need to save in an arrayList the name and age of 10 people and then print the data of the pers ... dade(int idade) { this.idade=idade; } public String toString(){ return nome + " " + idade; } }

How to convert a list to string and vice versa?

I have a list: ('47075', 'josenestle', 'i need help') I do str1 = str (list) and have in string. However if I do list (str1) I do not recover my list. I can't find any obvious solution, help would be very grateful.

View Java database values

I'm a beginner in Java and I'm making a mini RPG-style program for database testing, and I want to display the data contained ... emDB(); System.out.println(nwDB.showPersonagem()); } } while(opc != 3); } }

What are the applications of arrays in the day to day? (examples of its usability)

I did an internet search on the use of arrays and found many results aimed at creating games only... But other than this exam ... on the day a day ("it is not the focus of java" and you will see why when we study database")... But curiosity still stayed.

How do I display object information from my ArrayList?

I want to create a ArrayList to store information about students (name, typeset number and status) but I'm not getting ArrayL ... System.out.println(turma.getInfo()); // o erro acontece nesta linha } } } What's wrong with my code?

Print arraylist information on screen

I have a ArrayList but I am not being able to print the data on the screen. Follows Class: public class Cachorro { p ... cc = new Cachorro("rotweiller","preto","Flora","Cesar",8); dog.add(cc); System.out.println(dog); } }