Меню

Array initializer expected java ошибка

gredwhite

44 / 44 / 11

Регистрация: 21.01.2013

Сообщений: 668

1

07.03.2014, 00:50. Показов 1438. Ответов 9

Метки нет (Все метки)


Java
1
2
3
4
  List<Object[]> d = new ArrayList<Object[]>();
  
  d.add({"A"});//compile error
  Object [] arr = {"A"};//valid

вроде по сути во 2 и 3 строчке одно и тоже делается, но 2 строчка не компилится.

почему?

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



harlins

2 / 2 / 3

Регистрация: 22.10.2013

Сообщений: 41

07.03.2014, 00:53

2

Так попробуй

Java
1
d.add("A");

Добавлено через 59 секунд
а вообще помойому нужно так

Java
1
2
3
List<Object> d = new ArrayList<Object>();
  
  d.add("A");



0



Insane__

43 / 43 / 15

Регистрация: 10.09.2013

Сообщений: 293

07.03.2014, 02:13

3

Цитата
Сообщение от gredwhite
Посмотреть сообщение

почему?

Возможно потому что Вы пытаетесь добавить этот массив на стадии выполнения программы, а в 3 строке создается массив на этапе компиляции. Как вариант можно добавить так:

Java
1
d.add(new Object[]{"A"});



0



Эксперт Java

4087 / 3821 / 745

Регистрация: 18.05.2010

Сообщений: 9,331

Записей в блоге: 11

07.03.2014, 07:01

4

упс



0



verylazy

Заблокирован

07.03.2014, 11:06

5

Может конечно это и не так, но мне кажется диким вот так создавать массив d.add({«A»});
Эти скобки {} еще не гарантия того, что все между ними — элементы будущего массива.

Мне кажется тут просто синтаксическая ошибка.
Если создать метод, который на вход будет принимать Object[] то вот так вот {«A»} передать туда параметр не получится.



0



gredwhite

44 / 44 / 11

Регистрация: 21.01.2013

Сообщений: 668

07.03.2014, 11:56

 [ТС]

6

не, ребят, вы что-то нагородили, кажется.

Java
1
2
3
4
Object [] arr = {"A"};//valid
 
Object [] arr;
arr= {"A"};//та же самая ошибка

меня лично такое объяснение устраивает



0



verylazy

Заблокирован

07.03.2014, 12:10

7

Цитата
Сообщение от gredwhite
Посмотреть сообщение

не, ребят, вы что-то нагородили,

лолшто?

Добавлено через 9 минут

Java
1
2
3
Object[] arr;
arr = new Object[]{"ы"}; // valid
arr = {"ы"}; // error

намекаю



0



44 / 44 / 11

Регистрация: 21.01.2013

Сообщений: 668

07.03.2014, 12:33

 [ТС]

8

не знаю про что вы, но я про то, что присвоение и инициализация при создании это разные вещи. При передачи в метод работает присвоение.



0



verylazy

Заблокирован

07.03.2014, 12:38

9

Цитата
Сообщение от gredwhite
Посмотреть сообщение

вроде по сути во 2 и 3 строчке одно и тоже делается, но 2 строчка не компилится.
почему?

Цитата
Сообщение от gredwhite
Посмотреть сообщение

не, ребят, вы что-то нагородили, кажется.

Цитата
Сообщение от gredwhite
Посмотреть сообщение

меня лично такое объяснение устраивае

я об этом
как бы изначально ясно было почему ошибка, а тут получается что МЫ намудрили?



0



44 / 44 / 11

Регистрация: 21.01.2013

Сообщений: 668

07.03.2014, 12:41

 [ТС]

10

Цитата
Сообщение от verylazy
Посмотреть сообщение

как бы изначально ясно было почему ошибка,

мне то не ясно было, поэтому и спрашивал.

Ответы не приблизили меня к пониманию, но сам разобдрался.



0



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

07.03.2014, 12:41

Помогаю со студенческими работами здесь

Код не компилируется
#include &lt;stdio.h&gt;
main()
{
int с;
с = getchar();
while (с != EOF)
{
putchar…

Не компилируется код
Вот прога:
#include &lt;stdio.h&gt;

struct Element{ // структура, задающая элемент списка

Не компилируется код
Добрый день !
Решил код с IAR переделать GCC Avr STUDIO
Вот весь код
#define…

Не компилируется код
#iclude &lt;sys/types.h&gt;
#include &lt;unistd.h&gt;
#inlude &lt;stdio.h&gt;
Int main()
{
pid_t pid, ppid;

Не компилируется код
#include &lt;iostream&gt;
#include &lt;iomanip&gt;
#include &lt;stdlib.h&gt;
#include &lt;math.h&gt;
using namespace…

Код не компилируется
Объясните пож-та, почему код не компилируется:

// File Output.cpp: определяет точку входа для…

Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:

10

I am working on Android project and I am getting an error which I cannot understand:

Array initializer is not allowed here

I tried to simplify my code and it comes down to this

public class MainActivity extends Activity{

    int pos = {0, 1, 2};

    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        pos = {2, 1, 0};
    }
}

What is going on here?

Ivar's user avatar

Ivar

5,85012 gold badges53 silver badges60 bronze badges

asked Jan 15, 2017 at 6:33

Abdurakhmon's user avatar

1

You should use

pos = new int[]{1,2,3};

You can only use the abbreviated syntax int[] pos = {0,1,2}; at variable initialization time.

private int[] values1 = new int[]{1,2,3,4};
private int[] values2 = {1,2,3,4}; // short form is allowed only at variable initialization

Community's user avatar

answered Jan 15, 2017 at 6:51

Jayanth's user avatar

JayanthJayanth

5,6763 gold badges20 silver badges36 bronze badges

Your initialization statement is wrong: you must add square brackets to declare an array (and here you can omit the new keyword because you’re declaring and initializing the variable at the same time):

int[] pos = { 0, 1, 2 };

In the onCreate method, you can’t omit the new keyword because the variable was already declared, so you have to write:

pos = new int[] { 2, 1, 0 };

You can read the Oracle documentation and the Java Language Specs for more details.

answered Jan 15, 2017 at 7:27

Robert Hume's user avatar

Robert HumeRobert Hume

1,0992 gold badges14 silver badges25 bronze badges

use the following syntax to declare/initialize and empty array, and then populated it with data:

String[] menuArray = {};
menuArray = new String[]{"new item","item 2"};

KirstieBallance's user avatar

answered Feb 7, 2018 at 10:22

saigopi.me's user avatar

saigopi.mesaigopi.me

13k2 gold badges79 silver badges54 bronze badges

This is a compile-time error Illegal Initializer for int.
You could solve this problem by adding square braces after your variable’s data type like this:

int[] pos = {0, 1, 2};

answered Mar 3, 2019 at 18:11

thejufo's user avatar

thejufothejufo

1231 silver badge7 bronze badges

как объявить и инициализировать массив в Java?

19 ответов


вы можете использовать объявление массива или литерал массива (но только когда вы объявляете и влияете на переменную сразу, литералы массива не могут использоваться для повторного назначения массива).

для примитивных типов:

int[] myIntArray = new int[3];
int[] myIntArray = {1,2,3};
int[] myIntArray = new int[]{1,2,3};

для классов, например String, Это-же:

String[] myStringArray = new String[3];
String[] myStringArray = {"a","b","c"};
String[] myStringArray = new String[]{"a","b","c"};

третий способ инициализации полезен, когда вы сначала объявляете массив, а затем инициализируете его. Актерский состав здесь.

String[] myStringArray;
myStringArray = new String[]{"a","b","c"};

существует два типа массива.

Одномерный Массив

синтаксис значений по умолчанию:

int[] num = new int[5];

или (менее предпочтительно)

int num[] = new int[5];

синтаксис с заданными значениями (инициализация переменной / поля):

int[] num = {1,2,3,4,5};

или (менее предпочтительно)

int num[] = {1, 2, 3, 4, 5};

Примечание: Для удобства int[] num предпочтительнее, потому что он ясно говорит, что вы говорите здесь о массиве. Иначе никакой разницы. Не все.

многомерный массив

декларация

int[][] num = new int[5][2];

или

int num[][] = new int[5][2];

или

int[] num[] = new int[5][2];

инициализации

 num[0][0]=1;
 num[0][1]=2;
 num[1][0]=1;
 num[1][1]=2;
 num[2][0]=1;
 num[2][1]=2;
 num[3][0]=1;
 num[3][1]=2;
 num[4][0]=1;
 num[4][1]=2;

или

 int[][] num={ {1,2}, {1,2}, {1,2}, {1,2}, {1,2} };

рваный массив (или непрямой массив)

 int[][] num = new int[5][];
 num[0] = new int[1];
 num[1] = new int[5];
 num[2] = new int[2];
 num[3] = new int[3];

Итак, здесь мы явно определяем столбцы.
Иначе:

int[][] num={ {1}, {1,2}, {1,2,3,4,5}, {1,2}, {1,2,3} };

для Доступ:

for (int i=0; i<(num.length); i++ ) {
    for (int j=0;j<num[i].length;j++)
        System.out.println(num[i][j]);
}

кроме того:

for (int[] a : num) {
  for (int i : a) {
    System.out.println(i);
  }
}

рваные массивы многомерные массивы.
Для объяснения см. подробности многомерного массива в официальные учебники java

226

автор: Isabella Engineer


Type[] variableName = new Type[capacity];

Type[] variableName = {comma-delimited values};



Type variableName[] = new Type[capacity]; 

Type variableName[] = {comma-delimited values};

также допустимо, но я предпочитаю скобки после типа, потому что легче увидеть, что тип переменной на самом деле является массивом.


существуют различные способы объявления массива в Java:

float floatArray[]; // Initialize later
int[] integerArray = new int[10];
String[] array = new String[] {"a", "b"};

вы можете найти более подробную информацию в Sun учебник сайт и JavaDoc.


Я считаю, это полезно, если вы понимаете каждую часть:

Type[] name = new Type[5];

Type[] — это тип на переменная called name («имя» называется идентификатор). Литерал «Type» является базовым типом, а скобки означают, что это тип массива этой базы. Типы массивов, в свою очередь, являются собственными типами, что позволяет создавать многомерные массивы типа Type[][] (массив типа[]). Ключевое слово new говорит выделить память для нового массива. Число между скобками говорит о том, насколько большим будет новый массив и сколько памяти нужно выделить. Например, если Java знает, что базовый тип Type занимает 32 байта, и вы хотите массив размером 5, он должен внутренне выделить 32 * 5 = 160 байт.

вы также можете создавать массивы с уже имеющимися значениями, такими как

int[] name = {1, 2, 3, 4, 5};

, который не только создает пустое пространство, но и наполняет эти ценности. Java может сказать, что примитивы целых чисел и что их 5, поэтому размер массива можно определить неявно.


ниже представлены объявления массива, но массив не инициализируется:

 int[] myIntArray = new int[3];

ниже показано объявление, а также инициализация массива:

int[] myIntArray = {1,2,3};

теперь следующее также показывает объявление, а также инициализацию массива:

int[] myIntArray = new int[]{1,2,3};

но этот третий показывает свойство анонимного создания массива-объекта, на которое указывает ссылочная переменная «myIntArray», поэтому, если мы напишем просто » new int [] {1,2,3}; » тогда вот как можно создать анонимный объект-массив.

если мы просто пишем:

int[] myIntArray;

это не объявление массива, но следующий оператор делает вышеуказанное объявление полным:

myIntArray=new int[3];

кроме того,

// Either method works
String arrayName[] = new String[10];
String[] arrayName = new String[10];

объявляет массив с именем arrayName размера 10 (у вас есть элементы от 0 до 9 для использования).


кроме того, если вы хотите что-то более динамичное, есть интерфейс списка. Это не будет выполнять, как хорошо, но является более гибким:

List<String> listOfString = new ArrayList<String>();

listOfString.add("foo");
listOfString.add("bar");

String value = listOfString.get(0);
assertEquals( value, "foo" );

существует два основных способа создания массива:

Этот, для пустого массива:

int[] array = new int[n]; // "n" being the number of spaces to allocate in the array

и этот, для инициализированного массива:

int[] array = {1,2,3,4 ...};

вы также можете сделать многомерные массивы, как это:

int[][] array2d = new int[x][y]; // "x" and "y" specify the dimensions
int[][] array2d = { {1,2,3 ...}, {4,5,6 ...} ...};

возьмем примитивный тип int например. Существует несколько способов объявить и int время:

int[] i = new int[capacity];
int[] i = new int[] {value1, value2, value3, etc};
int[] i = {value1, value2, value3, etc};

где во всех этих, Вы можете использовать int i[] вместо int[] i.

С отражением, вы можете использовать (Type[]) Array.newInstance(Type.class, capacity);

обратите внимание, что в параметрах метода, ... указано variable arguments. По сути, любое количество параметров прекрасно. Это проще объяснить с помощью кода:

public static void varargs(int fixed1, String fixed2, int... varargs) {...}
...
varargs(0, "", 100); // fixed1 = 0, fixed2 = "", varargs = {100}
varargs(0, "", 100, 200); // fixed1 = 0, fixed2 = "", varargs = {100, 200};

внутри метода, varargs рассматривается как нормальный int[]. Type... может использоваться только в параметрах метода, поэтому int... i = new int[] {} не будет компилироваться.

обратите внимание, что при прохождении int[] к методу (или любому другому Type[]), вы не можете использовать третий способ. В заявлении int[] i = *{a, b, c, d, etc}*, компилятор предполагает, что {...} означает int[]. Но это потому, что вы объявляете переменную. При передаче массива методу объявление должно быть либо new Type[capacity] или new Type[] {...}.

Многомерная Массивы

многомерные массивы гораздо сложнее иметь дело. По сути, 2D-массив — это массив массивов. int[][] означает массив int[]s. Ключ в том, что если int[][] объявлен int[x][y], максимальный индекс i[x-1][y-1]. По сути, прямоугольный int[3][5] — это:

[0, 0] [1, 0] [2, 0]
[0, 1] [1, 1] [2, 1]
[0, 2] [1, 2] [2, 2]
[0, 3] [1, 3] [2, 3]
[0, 4] [1, 4] [2, 4]

Если вы хотите создавать массивы с помощью отражений, вы можете сделать следующее:

 int size = 3;
 int[] intArray = (int[]) Array.newInstance(int.class, size ); 

7

автор: Muhammad Suleman


объявление массива ссылок на объекты:

class Animal {}

class Horse extends Animal {
    public static void main(String[] args) {

        /*
         * Array of Animal can hold Animal and Horse (all subtypes of Animal allowed)
         */
        Animal[] a1 = new Animal[10];
        a1[0] = new Animal();
        a1[1] = new Horse();

        /*
         * Array of Animal can hold Animal and Horse and all subtype of Horse
         */
        Animal[] a2 = new Horse[10];
        a2[0] = new Animal();
        a2[1] = new Horse();

        /*
         * Array of Horse can hold only Horse and its subtype (if any) and not
           allowed supertype of Horse nor other subtype of Animal.
         */
        Horse[] h1 = new Horse[10];
        h1[0] = new Animal(); // Not allowed
        h1[1] = new Horse();

        /*
         * This can not be declared.
         */
        Horse[] h2 = new Animal[10]; // Not allowed
    }
}

массив представляет собой последовательный список элементов

int item = value;

int [] one_dimensional_array = { value, value, value, .., value };

int [][] two_dimensional_array =
{
  { value, value, value, .. value },
  { value, value, value, .. value },
    ..     ..     ..        ..
  { value, value, value, .. value }
};

если это объект, то это то же самое понятие

Object item = new Object();

Object [] one_dimensional_array = { new Object(), new Object(), .. new Object() };

Object [][] two_dimensional_array =
{
  { new Object(), new Object(), .. new Object() },
  { new Object(), new Object(), .. new Object() },
    ..            ..               ..
  { new Object(), new Object(), .. new Object() }
};

в случае объектов вам нужно либо назначить его null инициализировать их с помощью new Type(..) классы типа String и Integer особые случаи, которые будут обрабатываться следующим образом

String [] a = { "hello", "world" };
// is equivalent to
String [] a = { new String({'h','e','l','l','o'}), new String({'w','o','r','l','d'}) };

Integer [] b = { 1234, 5678 };
// is equivalent to
Integer [] b = { new Integer(1234), new Integer(5678) };

в общем, вы можете создавать массивы, которые M мерные

int [][]..[] array =
//  ^ M times [] brackets

    {{..{
//  ^ M times { bracket

//            this is array[0][0]..[0]
//                         ^ M times [0]

    }}..}
//  ^ M times } bracket
;

стоит отметить, что создание M размерный массив дорог с точки зрения пространства. С момента создания M мерный массив с N на всех измерениях общий размер массива больше, чем N^M, так как каждый массив имеет ссылку, а в M-измерении имеется (M-1)-мерный массив ссылок. Общий размер следующий

Space = N^M + N^(M-1) + N^(M-2) + .. + N^0
//      ^                              ^ array reference
//      ^ actual data

для создания массивов объектов, вы можете использовать java.util.ArrayList. чтобы определить массив:

public ArrayList<ClassName> arrayName;
arrayName = new ArrayList<ClassName>();

присвоить массиву значения:

arrayName.add(new ClassName(class parameters go here);

чтение из массива:

ClassName variableName = arrayName.get(index);

Примечание:

variableName является ссылкой на массив, означающий, что манипулирование variableName будет манипулировать arrayName

циклы:

//repeats for every value in the array
for (ClassName variableName : arrayName){
}
//Note that using this for loop prevents you from editing arrayName

для цикла, который позволяет редактировать arrayName (условный цикл):

for (int i = 0; i < arrayName.size(); i++){
    //manipulate array here
}

в Java 8 вы можете использовать, как это.

String[] strs = IntStream.range(0, 15)  // 15 is the size
    .mapToObj(i -> Integer.toString(i))
    .toArray(String[]::new);

В Java 9

используя разные IntStream.iterate и IntStream.takeWhile методы:

int[] a = IntStream.iterate(10, x -> x <= 100, x -> x + 10).toArray();

Out: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]


int[] b = IntStream.iterate(0, x -> x + 1).takeWhile(x -> x < 10).toArray();

Out: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

В Java 10

С помощью Вывод Типа Локальной Переменной:

var letters = new String[]{"A", "B", "C"};

объявить и инициализировать для Java 8 и выше. Создайте простой целочисленный массив:

int [] a1 = IntStream.range(1, 20).toArray();
System.out.println(Arrays.toString(a1));
// Output: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]

создайте случайный массив для целых чисел между [-50, 50] и для двойников [0, 1E17]:

int [] a2 = new Random().ints(15, -50, 50).toArray();
double [] a3 = new Random().doubles(5, 0, 1e17).toArray();

последовательность Power-of-two:

double [] a4 = LongStream.range(0, 7).mapToDouble(i -> Math.pow(2, i)).toArray();
System.out.println(Arrays.toString(a4));
// Output: [1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0]

для String[] необходимо указать конструктор:

String [] a5 = Stream.generate(()->"I will not squeak chalk").limit(5).toArray(String[]::new);
System.out.println(Arrays.toString(a5));

многомерные массивы:

String [][] a6 = List.of(new String[]{"a", "b", "c"} , new String[]{"d", "e", "f", "g"})
    .toArray(new String[0][]);
System.out.println(Arrays.deepToString(a6));
// Output: [[a, b, c], [d, e, f, g]]

3

автор: Kirill Podlivaev


другой способ объявить и инициализировать ArrayList:

private List<String> list = new ArrayList<String>(){{
    add("e1");
    add("e2");
}};

int[] SingleDimensionalArray = new int[2]

int[][] MultiDimensionalArray = new int[3][4]

Array initializer is not allowed here

The use of array is divided into declaration and initialization, which can be carried out simultaneously or separately

Int [] array; declaration

Array = New Int {element1, Element2, element3..}; initialization mode 1

Array = New Int [length]; initialization mode 2

There are two initialization methods for arrays

1、 Static initialization: the initial value of each array element is explicitly specified by the programmer during initialization;

    arrayName = new type[]{element1,element2,element3…}

2、 Dynamic initialization: when initializing, the programmer specifies the length of the array, and the system initializes the default value of each array element.

    arrayName = new type[length];

Note: do not use static initialization and dynamic initialization at the same time. In other words, do not specify the length of the array and divide each element of the array

The initial value is set.
 

Looking at the code today, we can see a simplified array initialization method, which belongs to the simplified version of static initialization, but there is something wrong with it

Int [] array = {1,2,3}; object [] obj = {}; this is OK

So I tried to write like this

Class member variables declare an array int [] elementdata, but it is not initialized;

Initialize it in the constructor, trying to write like this

Elementdata = {1,3,5}, so the above compilation error prompt appears

It seems that this simplified way of writing is not applicable here,

The use of arrays must be initialized

Suppose that elementdata = {1,3,5} does not generate new objects through new. Maybe the compiler thinks that it has been declared but not initialized

Therefore, it is recommended that the initialization is completed when the array is declared

Int [] elementdata = {1,3,5}; this is OK, declaration and assignment are done at the same time

У меня есть несколько классов Model, которые я пытаюсь объявить с ними, но я получаю Array initializer is not allowed here. Что было бы простой работой?

...
public class M1 extends Model {}
public class M2 extends Model {}

...
List<Model> mObj = new ArrayList<Model>({M1, M2}) //expression expected
...

25 сен. 2014, в 15:57

Поделиться

Источник

2 ответа

В Java 8 вы можете использовать API Streams:

List<String> mObj = Stream.of("m1","m2","m3").collect(Collectors.toList());

Pre Java 8 просто используйте:

List<Model> mObj = new ArrayList<>(Arrays.asList(m1, m2, m3));

Для получения информации об этом см.:

  • Collectors
  • Arrays.asList

ifloop
25 сен. 2014, в 10:57

Поделиться

Вы можете использовать Arrays.asList, который вернет List<Model>, а затем вы можете передать его конструктору ArrayList. Примечание, если вы назначаете напрямую List return Arrays.asList to List<Model>, тогда вызов метода, такого как add(), будет бросать UnsupportedOperationException, потому что Arrays.asList возвращает AbstractList

Вы должны изменить

List<Model> mObj = new ArrayList<Model>({M1, M2}) //expression expected

к

List<Model> mObj = new ArrayList<Model>(Arrays.asList(M1, M2));

поскольку конструктор класса ArrayList может принимать Collection<? extends Model>

sol4me
25 сен. 2014, в 10:13

Поделиться

Ещё вопросы

  • 0Структура базы данных SQL, включая списки в качестве записей
  • 0Нажмите на изображение, чтобы уменьшить его после развернутого
  • 0Как проверить значение поля <input>, если определенный текст все еще существует в javascript / jQuery
  • 1Android: URI для открытия изображения с ACTION View
  • 1Добавление целого числа в массив внутри узла
  • 0AngularJS: директива изолировать область
  • 1Как показать конкретную часть изображения в javafx
  • 0Элемент привязки всегда синего цвета, Как изменить его на красный на странице aspx
  • 0HTML-фитинги в div
  • 0Как обновить цвет фона кнопки с вычисленным значением при наведении курсора?
  • 1Spring Security / expired-url без перенаправления URL
  • 1Предотвращение NumPy от преобразования числовых значений в строки
  • 0ПОЛУЧИТЬ и ПОСТИТЬ в PDO
  • 0Объект Date возвращает NaN при попытке вычислить время между двумя датами в IE8
  • 1C # Как объединить некоторые выражения Linq в цикле
  • 0динамическое изменение высоты div с использованием javascript не работает
  • 0MySQL JSON хранит другое значение с плавающей запятой
  • 1Скрыть анимацию Border или TextBlock
  • 0Быстрый (est) способ удалить все элементы вектора из другого
  • 0AmStockCharts — обработчик события клика
  • 0Как прокрутить на заданное расстояние выше / ниже элемента с помощью JQuery?
  • 0Невозможно получить доступ к моему phpMyadmin (MAMP)
  • 0Передача Promise в качестве параметра не вызывает то или не вызывает обратные вызовы
  • 1Возьмите определенную подстроку из строки в python
  • 0Подготовьте операторы SQL и введите только, если не дубликаты
  • 0Невозможно сбросить флажки для снятых в угловых js
  • 1response-native-twilio-video-webrtc Ошибка компиляции Android
  • 1Неожиданное поведение JSON.stringify с массивами на конкретном веб-сайте
  • 1Использование JavaScript Promise асинхронно
  • 0Как устранить эту ошибку «Исправляемая фатальная ошибка: объект класса DateTime не может быть преобразован в строку в /var/www/web/print.php в строке 9»?
  • 1Прикрепленные свойства через элемент модели
  • 1В GAS чтение столбца данных на нескольких листах в электронной таблице с помощью цикла
  • 1При создании исполняемого файла с использованием Python2.7 и cx_Freeze я получаю следующую ошибку, связанную сPython.Runtime.dll «
  • 0Встроенная функция более или менее безопасная
  • 1Общий метод — Тип не может использоваться в качестве параметра типа
  • 0инкрементное значение внутри массива массивов (если ключ не существует, установите его равным 1)
  • 0Я теряю функциональность кнопки при смене фона
  • 0SQL для возврата значений из отношения «многие ко многим»
  • 1Макет чата с менеджером BoxLayout
  • 1какой метод подходит для переопределения растрового изображения?
  • 0Что не так с этой функцией? Вылетает моя программа без ошибок
  • 0разобрать php код как html используя htaccess
  • 0php искать исходный код URL для конкретного слова, а затем перенаправить на URL
  • 1Возникла ошибка при настройке для Apache JMeter HTTP (S) Test Script Recorder
  • 1Как создать исключение или установить ActionError перед установкой атрибута в FormBean
  • 0ng-click не стреляет в md-bottom-sheet
  • 1Как мы можем использовать существующую функциональность taglib в наших пользовательских тегах?
  • 0Автоматическая прокрутка аккордеона в верхнюю часть выделенного раздела
  • 0Split / Explode in String идентифицирует только первый элемент (Символ или Слово)?
  • 0Функция, которая преобразует базу 10 в двоичную систему, используя стеки для ее решения.

Сообщество Overcoder

# @interface (annotation) related messages annotation.unknown.method=Cannot resolve method »{0}» annotation.missing.method=Cannot find method »{0}» annotation.incompatible.types=Incompatible types. Found: »{0}», required: »{1}» annotation.illegal.array.initializer=Illegal initializer for »{0}» annotation.duplicate.annotation=Duplicate annotation annotation.duplicate.attribute=Duplicate attribute »{0}» annotation.missing.attribute={0} missing though required annotation.not.applicable=»@{0}» not applicable to {1} annotation.nonconstant.attribute.value=Attribute value must be constant annotation.invalid.annotation.member.type=Invalid type for annotation member annotation.cyclic.element.type=Cyclic annotation element type annotation.annotation.type.expected=Annotation type expected annotation.members.may.not.have.throws.list=@interface members may not have throws list annotation.may.not.have.extends.list=@interface may not have extends list annotation.name.is.missing=Annotation attribute must be of the form ‘name=value’ # These aren’t unused. # suppress inspection «UnusedProperty» annotation.target.ANNOTATION_TYPE=annotation type # suppress inspection «UnusedProperty» annotation.target.TYPE=type # suppress inspection «UnusedProperty» annotation.target.TYPE_USE=type use # suppress inspection «UnusedProperty» annotation.target.TYPE_PARAMETER=type parameter # suppress inspection «UnusedProperty» annotation.target.CONSTRUCTOR=constructor # suppress inspection «UnusedProperty» annotation.target.METHOD=method # suppress inspection «UnusedProperty» annotation.target.FIELD=field # suppress inspection «UnusedProperty» annotation.target.PARAMETER=parameter # suppress inspection «UnusedProperty» annotation.target.LOCAL_VARIABLE=local variable # suppress inspection «UnusedProperty» annotation.target.PACKAGE=package # generics related messages generics.holder.type=Type generics.holder.method=Method generics.are.not.supported=Generics are not supported at this language level generics.inferred.type.for.type.parameter.is.not.within.its.bound.extend=Inferred type »{2}» for type parameter »{0}» is not within its bound; should extend »{1}» generics.inferred.type.for.type.parameter.is.not.within.its.bound.implement=Inferred type »{2}» for type parameter »{0}» is not within its bound; should implement »{1}» generics.type.parameter.is.not.within.its.bound.extend=Type parameter »{0}» is not within its bound; should extend »{1}» generics.type.parameter.is.not.within.its.bound.implement=Type parameter »{0}» is not within its bound; should implement »{1}» # {0} — Type (class) or Method generics.type.or.method.does.not.have.type.parameters={0} »{1}» does not have type parameters generics.wrong.number.of.type.arguments=Wrong number of type arguments: {0}; required: {1} generics.cannot.be.inherited.with.different.type.arguments=»{0}» cannot be inherited with different type arguments: »{1}» and »{2}» generics.select.static.class.from.parameterized.type=Cannot select static class »{0}» from parameterized type generics.methods.have.same.erasure={0}; both methods have same erasure generics.methods.have.same.erasure.override={0}; both methods have same erasure, yet neither overrides the other generics.type.parameter.cannot.be.instantiated=Type parameter »{0}» cannot be instantiated directly wildcard.type.cannot.be.instantiated=Wildcard type »{0}» cannot be instantiated directly generics.wildcard.not.expected=No wildcard expected generics.wildcards.may.be.used.only.as.reference.parameters=Wildcards may be used only as reference parameters generics.type.argument.cannot.be.of.primitive.type=Type argument cannot be of primitive type generics.unchecked.assignment=Unchecked assignment: »{0}» to »{1}» generics.unchecked.cast=Unchecked cast: »{0}» to »{1}» generics.unchecked.call.to.member.of.raw.type=Unchecked call to »{0}» as a member of raw type »{1}» foreach.not.applicable=foreach not applicable to type »{0}». illegal.to.access.static.member.from.enum.constructor.or.instance.initializer=It is illegal to access static member »{0}» from enum constructor or instance initializer enum.types.cannot.be.instantiated=Enum types cannot be instantiated generic.array.creation=Generic array creation generics.enum.may.not.have.type.parameters=Enum may not have type parameters generics.annotation.members.may.not.have.type.parameters=@interface members may not have type parameters annotation.may.not.have.type.parameters=@interface may not have type parameters generics.duplicate.type.parameter=Duplicate type parameter: »{0}» generics.cannot.catch.type.parameters=Cannot catch type parameters generics.cannot.instanceof.type.parameters=Class or array expected illegal.generic.type.for.instanceof=Illegal generic type for instanceof cannot.select.dot.class.from.type.variable=Cannot select from a type variable method.doesnot.override.super=Method does not override method from its superclass call.to.super.is.not.allowed.in.enum.constructor=Call to super is not allowed in enum constructor vararg.not.last.parameter=Vararg parameter must be the last in the list modifiers.for.enum.constants=No modifiers allowed for enum constants generics.type.arguments.on.raw.type=Type arguments given on a raw type generics.type.arguments.on.raw.method=Type arguments given on a raw method classes.extends.enum=Classes cannot directly extend ‘java.lang.Enum’ unchecked.overriding.incompatible.return.type=Unchecked overriding: return type requires unchecked conversion. Found »{0}», required »{1}» unchecked.overriding=Unchecked overriding local.enum=Enum must not be local interface.expected=Interface expected here no.interface.expected=No interface expected here class.expected=Class name expected here implements.after.interface=No implements clause allowed for interface extends.after.enum=No extends clause allowed for enum static.declaration.in.inner.class=Inner classes cannot have static declarations class.must.be.abstract=Class »{0}» must either be declared abstract or implement abstract method »{1}» in »{2}» abstract.cannot.be.instantiated=»{0}» is abstract; cannot be instantiated duplicate.class.in.other.file=Duplicate class found in the file »{0}» duplicate.class=Duplicate class: »{0}» public.class.should.be.named.after.file=Class »{0}» is public, should be declared in a file named »{0}.java» inheritance.from.final.class=Cannot inherit from final »{0}» package.name.file.path.mismatch=Package name »{0}» does not correspond to the file path »{1}» missing.package.statement=Missing package statement: »{0}» interface.cannot.be.local=Modifier ‘interface’ not allowed here cyclic.inheritance=Cyclic inheritance involving »{0}» class.already.imported=»{0}» is already defined in this compilation unit class.cannot.extend.multiple.classes=Class cannot extend multiple classes not.allowed.in.interface=Not allowed in interface qualified.new.of.static.class=Qualified new of static class invalid.qualified.new=Invalid qualified new class.name.expected=Class name expected no.enclosing.instance.in.scope=No enclosing instance of type »{0}» is in scope externalizable.class.should.have.public.constructor=Externalizable class should have public no-args constructor is.not.an.enclosing.class=»{0}» is not an enclosing class cannot.be.referenced.from.static.context=»{0}» cannot be referenced from a static context no.default.constructor.available=There is no default constructor available in »{0}» missing.return.statement=Missing return statement unreachable.statement=Unreachable statement variable.not.initialized=Variable »{0}» might not have been initialized variable.already.assigned=Variable »{0}» might already have been assigned to variable.assigned.in.loop=Variable »{0}» might be assigned in loop assignment.to.final.variable=Cannot assign a value to final variable »{0}» variable.must.be.final=Variable »{0}» is accessed from within inner class. Needs to be declared final. initializer.must.be.able.to.complete.normally=Initializer must be able to complete normally weaker.privileges={0}; attempting to assign weaker access privileges (»{1}»); was »{2}» incompatible.return.type=attempting to use incompatible return type final.method.override=»{0}» cannot override »{1}» in »{2}»; overridden method is final overridden.method.does.not.throw={0}; overridden method does not throw »{1}» exception.is.never.thrown=Exception »{0}» is never thrown in the method wrong.method.arguments=»{0}» in »{1}» cannot be applied to »{2}» method.call.expected=Method call expected ambiguous.method.call=Ambiguous method call: both »{0}» and »{1}» match ambiguous.reference=Reference to »{0}» is ambiguous, both »{1}» and »{2}» match cannot.resolve.method=Cannot resolve method »{0}» missing.method.body=Missing method body, or declare abstract abstract.method.in.non.abstract.class=Abstract method in non-abstract class missing.return.type=Invalid method declaration; return type required duplicate.method=»{0}» is already defined in »{1}» constructor.call.must.be.first.statement=Call to »{0}» must be first statement in constructor body direct.abstract.method.access=Abstract method »{0}» cannot be accessed directly unrelated.overriding.methods.return.types=methods have unrelated return types overrides.deprecated.method=Overrides deprecated method in »{0}» recursive.constructor.invocation=Recursive constructor invocation wrong.constructor.arguments=»{0}» cannot be applied to »{1}» cannot.resolve.constructor=Cannot resolve constructor »{0}» invalid.package.annotation.containing.file=Package annotations should be in file package-info.java repeated.annotation.target=Repeated annotation target clash.methods.message=»{0}» clashes with »{1}» clash.methods.message.show.classes=»{0}» in »{2}» clashes with »{1}» in »{3}» # {0} — colspan, {1} — method1, {2} — class1, {3} — method2, {4} — class2 ambiguous.method.html.tooltip= <html><body><table border=0> <tr><td colspan={0}>Ambiguous method call. Both</td></tr> <tr>{1}<td>in <b>{2}</b>\&nbsp;and</td></tr> <tr>{3}<td>in <b>{4}</b>\&nbsp;match.</td></tr> </table></body></html> # {0} — colspan, {1} — method name, {2} — class name, {3} — formal parameters row, {4} — arguments row argument.mismatch.html.tooltip= <html><body><table border=0> <tr><td><b>{1}</b></td>{3}<td colspan={0}>in <b>{2}</b>\&nbsp;cannot be applied</td></tr> <tr><td>to</td>{4}</tr> </table></body></html> # {0} — left raw type, {1} — required row, {2} — right raw type, {3} — found row incompatible.types.html.tooltip= <html><body>Incompatible types.<table> <tr><td>Required:</td><td>{0}</td>{1}</tr> <tr><td>Found:</td><td>{2}</td>{3}</tr> </table></body></html> interface.methods.cannot.have.body=Interface methods cannot have body abstract.methods.cannot.have.a.body=Abstract methods cannot have a body native.methods.cannot.have.a.body=Native methods cannot have a body instance.method.cannot.override.static.method=Instance method »{0}» in »{1}» cannot override static method »{2}» in »{3}» static.method.cannot.override.instance.method=Static method »{0}» in »{1}» cannot override instance method »{2}» in »{3}» inconvertible.type.cast=Inconvertible types; cannot cast »{0}» to »{1}» variable.expected=Variable expected binary.operator.not.applicable=Operator »{0}» cannot be applied to »{1}»,»{2}» unary.operator.not.applicable=Operator »{0}» cannot be applied to »{1}» return.outside.method=Return outside method return.from.void.method=Cannot return a value from a method with void result type missing.return.value=Missing return value #{0] — exceptions list (comma separated). {1} — exceptions count in the list unhandled.exceptions=Unhandled {1, choice, 0#exception|2#exceptions}: {0} variable.already.defined=Variable »{0}» is already defined in the scope break.outside.switch.or.loop=Break outside switch or loop continue.outside.loop=Continue outside of loop not.loop.label=Not a loop label: »{0}» incompatible.modifiers=Illegal combination of modifiers: »{0}» and »{1}» modifier.not.allowed=Modifier »{0}» not allowed here exception.never.thrown.try=Exception »{0}» is never thrown in the corresponding try block not.a.statement=Not a statement incompatible.types=Incompatible types. Found: »{1}», required: »{0}» valid.switch.selector.types=byte, char, short or int dot.expected.after.super.or.this=‘.’ expected non.static.symbol.referenced.from.static.context=Non-static {0} »{1}» cannot be referenced from a static context private.symbol=»{0}» has private access in »{1}» protected.symbol=»{0}» has protected access in »{1}» package.local.symbol=»{0}» is not public in »{1}». Cannot be accessed from outside package visibility.access.problem=Cannot access »{0}» in »{1}» array.type.expected=Array type expected; found: »{0}» expression.expected=Expression expected case.statement.outside.switch=Case statement outside switch qualified.enum.constant.in.switch=An enum switch case label must be the unqualified name of an enumeration constant constant.expression.required=Constant expression required duplicate.default.switch.label=Duplicate default label duplicate.switch.label=Duplicate label »{0}» switch.colon.expected.after.case.label=‘:’ expected #See JLS 8.3.2.3 illegal.forward.reference=Illegal forward reference unknown.class=Unknown class: »{0}» illegal.type.void=Illegal type: ‘void’ member.referenced.before.constructor.called=Cannot reference »{0}» before supertype constructor has been called label.without.statement=Label without statement duplicate.label=Label »{0}» already in use nonterminated.comment=Unclosed comment assignment.to.itself=Variable is assigned to itself assignment.to.declared.variable=Variable »{0}» is initialized with self assignment exception.already.caught=Exception »{0}» has already been caught statement.must.be.prepended.with.case.label=Statement must be prepended with case label void.type.is.not.allowed=‘void’ type is not allowed here single.import.class.conflict=»{0}» is already defined in a single-type import numeric.overflow.in.expression=Numeric overflow in expression static.member.accessed.via.instance.reference=Static member »{0}.{1}» accessed via instance reference unresolved.label=Undefined label: »{0}» deprecated.symbol=»{0}» is deprecated cannot.resolve.symbol=Cannot resolve symbol »{0}» static.imports.prior.15=Static imports are not supported at this language level varargs.prior.15=Variable arity methods are not supported at this language level foreach.prior.15=Foreach loops are not supported at this language level annotations.prior.15=Annotations are not supported at this language level class.is.already.defined.in.single.type.import=class »{0}» is already defined in a single-type import field.is.already.defined.in.single.type.import=field »{0}» is already defined in a single-type import annotation.interface.members.may.not.have.parameters=@interface members may not have parameters local.variable.is.never.used=Variable »{0}» is never used local.variable.is.not.used.for.reading=Variable »{0}» is assigned but never accessed local.variable.is.not.assigned=Variable »{0}» is never assigned private.field.is.not.used=Private field »{0}» is never used field.is.not.used=Field »{0}» is never used private.field.is.not.used.for.reading=Private field »{0}» is assigned but never accessed private.field.is.not.assigned=Private field »{0}» is never assigned parameter.is.not.used=Parameter »{0}» is never used private.method.is.not.used=Private method »{0}» is never used method.is.not.used=Method »{0}» is never used constructor.is.not.used=Constructor »{0}» is never used private.constructor.is.not.used=Private constructor »{0}» is never used private.inner.class.is.not.used=Private inner class »{0}» is never used private.inner.interface.is.not.used=Private inner interface »{0}» is never used type.parameter.is.not.used=Type parameter »{0}» is never used local.class.is.not.used=Local class »{0}» is never used class.is.not.used=Class »{0}» is never used uidesigned.field.is.overwritten.by.generated.code=Field »{0}» is overwritten by generated code uidesigner.bound.field.type.mismatch=Types of GUI component (»{0}») and bound field (»{1}») do not match hexadecimal.numbers.must.contain.at.least.one.hexadecimal.digit=Hexadecimal numbers must contain at least one hexadecimal digit integer.number.too.large=Integer number too large long.number.too.large=Long number too large malformed.floating.point.literal=Malformed floating point literal illegal.line.end.in.character.literal=Illegal line end in character literal illegal.escape.character.in.character.literal=Illegal escape character in character literal too.many.characters.in.character.literal=Too many characters in character literal empty.character.literal=Empty character literal illegal.line.end.in.string.literal=Illegal line end in string literal illegal.escape.character.in.string.literal=Illegal escape character in string literal floating.point.number.too.large=Floating point number too large floating.point.number.too.small=Floating point number too small import.statement.identifier.or.asterisk.expected.=Identifier or ‘*’ expected javadoc.exception.tag.exception.class.expected=Exception class expected javadoc.exception.tag.wrong.tag.value=Wrong tag value javadoc.exception.tag.class.is.not.throwable=Class {0} is not a descendant of Throwable javadoc.exception.tag.exception.is.not.thrown={0} is not declared to be thrown by method {1} javadoc.param.tag.paramter.name.expected=Parameter name expected javadoc.param.tag.type.parameter.name.expected=Type parameter name expected javadoc.param.tag.type.parameter.gt.expected=‘>’ expected javadoc.value.tag.jdk15.required=@value tag may not have any arguments when JDK 1.4 or earlier is used javadoc.value.field.required=@value tag must reference a field javadoc.value.static.field.required=@value tag must reference a static field javadoc.value.field.with.initializer.required=@value tag must reference a field with a constant initializer expected.identifier=Identifier expected expected.comma.or.semicolon=‘,’ or ‘;’ expected unexpected.token=Unexpected token expected.class.or.interface=‘class’ or ‘interface’ expected expected.identifier.or.type=Identifier or type expected expected.rbracket=‘]’ expected expected.expression=Expression expected expected.semicolon=‘;’ expected expected.class.reference=Class reference expected expected.lparen=‘(‘ expected expected.rparen=‘)’ expected expected.eq=‘=’ expected expected.value=Value expected expected.rbrace=‘}’ expected expected.lbrace=‘{‘ expected unexpected.identifier=Unexpected identifier expected.gt=‘>’ expected. expected.lbrace.or.semicolon=‘{‘ or ‘;’ expected expected.parameter=Parameter expected expected.type.parameter=Type parameter expected expected.comma=‘,’ expected expected.comma.or.rparen=‘,’ or ‘)’ expected unexpected.tokens.beyond.the.end.of.expression=Unexpected token(s) beyond the end of expression expected.colon=‘:’ expected expected.type=Type expected expected.lbracket=‘[‘ expected expected.lparen.or.lbracket=‘(‘ or ‘[‘ expected expected.array.initializer=Array initializer expected unexpected.tokens=Unexpected tokens expected.gt.or.comma=‘>’ or ‘,’ expected. else.without.if=‘else’ without ‘if’ catch.without.try=‘catch’ without ‘try’ finally.without.try=‘finally’ without ‘try’ expected.statement=Statement expected expected.while=‘while’ expected expected.catch.or.finally=‘catch’ or ‘finally’ expected expected.boolean.expression=Boolean expression expected error.cannot.resolve.class=Cannot resolve class »{0}» error.cannot.resolve.class.or.package=Cannot resolve class or package »{0}» expected.class.or.package=Expected class or package suspicious.name.assignment=»{0}» should probably not be assigned to »{1}» suspicious.name.parameter=»{0}» should probably not be passed as parameter »{1}» suspicious.name.return=»{0}» should probably not be returned from method »{1}» type.parameter.cannot.be.followed.by.other.bounds=Type parameter cannot be followed by other bounds generic.extend.exception=Generic class may not extend ‘java.lang.Throwable’ illegal.initializer=Illegal initializer for »{0}» class.cannot.inherit.from.its.type.parameter=Class cannot inherit from its type parameter cannot.resolve.package=Cannot resolve package {0} override.not.allowed.in.interfaces=@Override is not allowed when implementing interface method

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ariston avsf 129 ошибка f 12
  • Ariston avsf 129 коды ошибок