arraylist

gli elementi di sottoclasse di un arraylist non utilizzeranno il metodo sovrascritto in Java

Ho un ArrayList con una certa classe (Pezzo) da cui voglio scegliere oggetti con una sottoclasse (Minatore e Bomba). Tuttavia ... c boolean canDefeat(Bomb opponent) { return true; } } Bomba di classe: public class Bomb extends Piece { }

MOOC JAVA parte 1 ESERCIZIO 101 (funzionalità di ricerca). Non ottenere l'output desiderato

Quindi l'esercizio è : "Aggiungi alla libreria di classi i metodi public ArrayList searchByTitle(String title), public ArrayL ... u come fallo. Sono un principiante nella programmazione e vogliono che usi ArrayList<Book> found nei metodi di ricerca.

Come cercare e visualizzare un oggetto per numero ID in un java Arraylist?

Ho davvero bisogno di aiuto con il mio programma. Sono nuovo di Arraylist e non ho idea di come posso cercare e visualizzare ... ) { return position; } public void setPosition(String position) { this.position = position; } }

Perché non riesco a trovare l'errore del simbolo? Sono cieco / apprendimento Java

import java.util.*; public class centeredAverage { public static void main(int[] nums) { int count = 0; int max = ... numero 16: Impossibile trovare il simbolo Simbolo: metodo sottolista(int,int) Posizione: numeri variabili di tipo int []

Java: ottenere un indice fuori dai limiti eccezione

Contesto Creazione di un assemblatore in Java: Sto cercando di leggere l'input dell'utente in un ArrayList chiamato v. Se l ... Eccezione nel thread "principale" java.lang.IndexOutOfBoundsException: Se voi ragazzi poteste aiutare sarebbe apprezzato.

Un lettore del corpo del messaggio per la classe Java java.util.Elenco e tipo Java java.util.Elenco

Un lettore del corpo del messaggio per la classe Java java.util.Elenco e tipo Java java.util.Elenco e MIME media type applica ... raversato tutti i collegamenti correlati, ma non poteva risolvere. Per favore aiutami a risolvere questo. Grazie in anticipo.

Is it possible to sort the ArrayList?

There is a ArrayList of the form String : int. How do I sort it in ascending/descending order by "column" int ? Here is a sa ... ally, I want to sort the resulting collection by numbers and get something like this: велосипед, 2 машина, 10 мотоцикл, 15

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 в этот массив.

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

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.

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) { } } }

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++; } } }

Java, sorting a list of strings in forward and reverse order

Eat a list of lines: "Ivanov" "Ivankin" "Ivchenko" "Lavrienko" "Lavochkin" "Abramov" "Abdulov" "Akrin" "Tsiganov" They must ... n " "Tsiganov" As I understand it, you need to use 2 comparators, but how I have no idea how to implement this in the code.

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(); }

Redefining the add sheet methods

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

Fill in textarea from another java class

There is a class Main public class Main extends Application{ //Объявляем переменные для компонентов формы Button but ... in zurnal and last10 with the values from search and searchCopy, respectively, when calling the XmlParser.xmlMethod() method?

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 ... ne example of a dynamic array is an ArrayList and you need to implement methods like it. Thank you in advance for your help!