import java.awt.List;import java.util.ArrayList;import java.util.Arrays;public class WwArrays {public static void main(String[] args) {int[] e = {1,2,22,32,12,325,323,42};List list = new ArrayList();list = Arrays.asList(e);System.out.println(List.get

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 16:46:57
importjava.awt.List;importjava.util.ArrayList;importjava.util.Arrays;publicclassWwArrays{publicstati

import java.awt.List;import java.util.ArrayList;import java.util.Arrays;public class WwArrays {public static void main(String[] args) {int[] e = {1,2,22,32,12,325,323,42};List list = new ArrayList();list = Arrays.asList(e);System.out.println(List.get
import java.awt.List;
import java.util.ArrayList;
import java.util.Arrays;
public class WwArrays {
public static void main(String[] args) {
int[] e = {1,2,22,32,12,325,323,42};
List list = new ArrayList();
list = Arrays.asList(e);
System.out.println(List.get(0)[1]);
}
报了一个异常:请各位大虾帮我看看问题出在哪?
Exception in thread "main" java.lang.Error:Unresolved compilation problems:
The type List is not generic; it cannot be parameterized with arguments
The method get(int) is undefined for the type List
点击左边的小问号说:
the type List is not generic ,it can not be parameterized with argments int[].

import java.awt.List;import java.util.ArrayList;import java.util.Arrays;public class WwArrays {public static void main(String[] args) {int[] e = {1,2,22,32,12,325,323,42};List list = new ArrayList();list = Arrays.asList(e);System.out.println(List.get
抱歉,问题不是因为这个,你的代码问题如下:
1.你的List引用错了import java.awt.List;,不应该是这个,应该是java.util.List;
2.System.out.println(List.get(0)[1]);里的List应该是list对象,你写错了
3.最后你还少了一个}
:)
另外,List,Map,Set里建议使用Integer之类的对象,而不要用int,好像jdk1.5以后增加了可以使用int之类的.嘿嘿.

import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.sql.*; public class a 求解释import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; The import java.awt is never used java 画矩形package testFrame;import java.awt.Color;import java.awt.Component;import java.awt.Frame;import java.awt.Graphics;import java.awt.Rectangle;public class FrameTest extends Frame {/*** @param args*/Rectangle rec;Frame f;public void paint(G import java.awt.*import java.awt.event.*为什么还要下面的那个语句.? import java.awt.List;import java.util.ArrayList;import java.util.Arrays;public class WwArrays {public static void main(String[] args) {int[] e = {1,2,22,32,12,325,323,42};List list = new ArrayList();list = Arrays.asList(e);System.out.println(List.get 要详细点的哈 我是新手 不太懂哦// Java core packagesimport java.awt.*;import java.awt.event.*;import java.awt.geom.*;import java.util.*;// Java extension packagesimport javax.swing.*;import javax.swing.BorderFactory;import javax.swing.ev 英语翻译import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.border.*;import java.util.Vector;import java.net.*;import java.io.*;class FindFriend2 extends JFrame {//查找好友类JLabel jLabel1 = new JLabel();JButton import+java.awt.Graphics;+和++import+java.applet.Applet;这两条语句的作用 import java.awt.*; import java.awt.event.*; import javax.swing.*;为什么写JAVA程序总是要写上这些东西?可以不写上吗?不写上会怎样? 麻烦高手帮我改一下这个程序import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.*;public class ccc extends JFrame implements ActionListener {JPanel n1;JButton n2;JButton n3;JButton n4 如果要使用 java.awt.Button这个类,下面哪个用法是正确的?A.import java.awt.Button;B.什么也不做C.package java.awt.*;D.import java.awt.event.Button java烟花程序看不懂,初学java希望每句给出解释import java.awt.*;import java.applet.*;import java.awt.event.*;import javax.swing.*;public class Fireworks extends Applet implements MouseListener,Runnable{int x,y;int top,point;public void java一个小错误,帮忙看下啊,超级感谢import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.event.CaretEvent;import javax.swing.event.CaretListener;public class NumberFrame extends JFrame implements CaretListener 有没有哪个好心人可以帮我运行一下这个JAVA程序?告诉我运行的结果是什么样.import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.border.*;public class GRIDRAWING{public static void main(String ar 编写一个Applet程序,从键盘输入一个整数,求出其阶乘值.刚学JAVA编不太来自个儿编得如下import java.applet.*;import java.awt.*;import jva.awt.event.*;public class Test3_2 extends Applet implements ActionListener{Label promp 我这个java计算器为啥只能输入一位数?import java.awt.*;import java.awt.event.*;import javax.swing.*;public class NewCalculator extends WindowAdapter { JPanel j1 = new JPanel(); JPanel j2 = new JPanel(); JTextField jt = new JTextField(3) java题目要求我们按left排布就按从做向右排布,按center排布就按从中间排布,按right就按从右向左排布!import java.awt.*;import java.awt.event.*;import javax.swing.*;import javax.swing.JButton;import javax.swing.JFrame;impo