Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

toArray question?

Posted on 2004-11-30
9
Medium Priority
?
311 Views
Last Modified: 2010-03-31
Hello,

When I compiled this example, I got an error undefined symbol list. Any thoughts?

ArrayList list = new ArrayList();

Graph[] graphs = (Graph[])list.toArray(new Graph[0]);
0
Comment
Question by:AntoniRyszard656
  • 4
  • 3
7 Comments
 
LVL 13

Expert Comment

by:petmagdy
ID: 12704429
please post ur imports
0
 
LVL 13

Expert Comment

by:petmagdy
ID: 12704431
and ur stack trace
0
 

Author Comment

by:AntoniRyszard656
ID: 12704446

I used import java.util.*; and import java.io.*;

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:petmagdy
ID: 12704452
and where is Graph Class package?
0
 

Author Comment

by:AntoniRyszard656
ID: 12704477

I declared the main class as Test, and Graph is declared in the same file, and located in the jdk bin directory.
0
 
LVL 13

Accepted Solution

by:
petmagdy earned 240 total points
ID: 12704489
>>and located in the jdk bin directory.
jdk bin is not related to any thing here, put ur Graph Code in a separate file Graph.java in the same Directory as Test and in the same package if Test is in a package and then compile both classes
0
 

Author Comment

by:AntoniRyszard656
ID: 12704506
ok, I will try this.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month21 days, 2 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question