473,804 Members | 4,518 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Really simple problem i expect - cannot resolve symbol

3 New Member
Hi,

i am fairly new to java and have been stuck on this for ages, basically i need to create a new object which gets a list of data from a text file, so i have this

Expand|Select|Wrap|Line Numbers
  1. import java.io.*;
  2.  
  3. import java.util.*;
  4.  
  5. public class Tester {
  6.  
  7. public static void main( String args[] ) {
  8.  
  9. File checkerFile = new File("dictionary.txt");
  10.  
  11. Dictionary aDictionary = new Dictionary(checkerFile);
  12.  
  13.  
  14. }
  15.  
  16. }
  17.  
And ive tried many different ways of writing it but i dont understand why it wont create the object, it just says the error message.

...\Tester.java :17: cannot resolve symbol
symbol : constructor Dictionary (java.io.File)
location: class Dictionary
Dictionary aDictionary = new Dictionary(dict ionaryFile);

Thanks for any help
May 3 '07 #1
3 2384
prometheuzz
197 Recognized Expert New Member
Hi,

...

...\Tester.java :17: cannot resolve symbol
symbol : constructor Dictionary (java.io.File)
location: class Dictionary
Dictionary aDictionary = new Dictionary(dict ionaryFile);

Thanks for any help
What the compiler is telling you is that it can't find a constructor in your Dictionary class which takes a java.io.File object as a parameter.
May 3 '07 #2
adamrace
3 New Member
Ah ok i understand thanks, ive looked in the dictionary class and it has this.

Expand|Select|Wrap|Line Numbers
  1. public Dictionary( String fileName ) 
  2.  
Does this mean that you just need the name of the file rather than the file opened itself and then open it later? How would you implement it into the other code?

Thanks for your help
May 3 '07 #3
prometheuzz
197 Recognized Expert New Member
Ah ok i understand thanks, ive looked in the dictionary class and it has this.

Expand|Select|Wrap|Line Numbers
  1. public Dictionary( String fileName ) 
  2.  
Does this mean that you just need the name of the file rather than the file ...
That can be easily answered by trying to do that and see if the compiler has no objections.
May 4 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
8234
by: Mike Dee | last post by:
A very very basic UTF-8 question that's driving me nuts: If I have this in the beginning of my Python script in Linux: #!/usr/bin/env python # -*- coding: UTF-8 -*- should I - or should I not - be able to use non-ASCII characters in strings and in Tk GUI button labels and GUI window titles and in raw_input data without Python returning wrong case in manipulated
1
6414
by: yanwan | last post by:
I met this problem in executing a c++ project in visual studio. Does anyone have suggestions to resolve "error lnk 2001"? --------------------Configuration: reconstruction - Win32 Debug-------------------- Linking... icarus_camera.obj : error LNK2001: unresolved external symbol _dgels_ icarus_leastsquares.obj : error LNK2001: unresolved external symbol _dgels_ icarus_maths.obj : error LNK2001: unresolved external symbol _dgels_...
1
24808
by: Tony Johansson | last post by:
Hello! I get compile error when compiling using the command javac from the command terminal window(CMD). I have just two classes which are called HelloWorld.java and Slask.java. I have both classes in the directory called temp and I do cd temp to this directory. Then I do javac HelloWorld.java Now I get the compile error HelloWorld.java:8 cannot resolve symbol
1
4635
by: vsp15584 | last post by:
Hii..i use the coding as below :- import java.applet.applet; import java.awt.*; import com.sun.j3d.utils.applet.mainframe; import com.sun.j3d.utils.universe.*; import com.sun.j3d.utils.geometry.*; import javax.media.j3d.*; import javax.vecmath.*;
3
2358
by: toish | last post by:
I have a program, aaa.java which creates an instance of another class(bbb.java). both java files are in a package entitled 'diss' bbb.java compiles sucessfully aaa.java throws a cannot resolve symbol error when aaa is referenced. aaa.java imports the package diss, as well as being part of it. both files are in the same directory. These files compile sucessfully using Java 1.5, when using Tomcat V.4 the above compilation error is thrown...
2
6667
by: karinmorena | last post by:
I'm having 4 errors, I'm very new at this and I would appreciate your input. The error I get is: Week5MortgageGUI.java:151:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI Week5MortgageLogic allint = logic.allInterest(amount, term, rate); Week5MortgageGUI.java:152:cannot find symbol symbol: method allInterest(double,double,double) Location: class Week5MortgageGUI
15
6464
by: Seral1969 | last post by:
Hi, I'm new to Java... I've been trying to get one of my professor's examples to work... He says that the code is fine, but I keep getting 4 "cannot resolve symbol" errors when I try to compile the ShowStudent.java file... The code for the Student class and ShowStudent program are listed below... PLEASE HELP!!!
7
4093
by: Spectrum | last post by:
I am writing some Python code using the Message Passing Interface (MPI), an API used in parallel computing. There exist a number of Python implementations of MPI, but apparently they all rely on the Numeric Python (numpy) package. I need to run my code on a particular machine made available by my university, which does not have numpy and will not be getting it. So I am trying to write my own mini-wrapper for MPI in C to extend my Python...
3
3194
by: Sindhu Rani | last post by:
i hav created 3 classes in 3 different files. am gettin an error durin compilation. wat shud i do??? C:\s\source>javac -d ..\classes devtestdrive.java devtestdrive.java:5: cannot resolve symbol symbol : class device location: class devtestdrive device d1=new tv(); ^ devtestdrive.java:5: cannot resolve symbol symbol : class tv
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7620
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5521
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.