| Author |
Problem using javac: cannot find symbol(method)
|
Rob Sweeny
Greenhorn
Joined: Jan 14, 2010
Posts: 16
|
|
Hi All,
I've been able to compile my supporting class file FloatNumber, but not my main class, MainFloatNumber.
CODE:
DIRECTORY HIERARCHY:
C:\code\src\com\scjaexam\tutorial
C:\code\src\com\scjaexam\tutorial\floatnumbers
C:\code\classes\com\scjaexam\tutorial
C:\code\classes\com\scjaexam\tutorial\floatnumbers
JAVAC:
c:\code>javac -d classes c:\code\src\com\scjaexam\tutorial\floatnumbers\FloatNumber.java
___compiles, and puts class file in correct location
___C:\code\classes\com\scjaexam\tutorial\floatnumbers\FloatNumber.class
c:\code>javac -d classes -cp classes c:\code\src\com\scjaexam\tutorial\MainFloatNumber.java
c:\code\src\com\scjaexam\tutorial\MainFloatNumber.java:7: cannot find symbol
symbol : method FloatNumber(float)
location: class com.scjaexam.tutorial.MainFloatNumber
FloatNumber value = FloatNumber(1f);
Any help would be appreciated.
Rob
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16690
|
|
If you want to instantiate an object, you should use the "new" operator.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
 |
|
|
subject: Problem using javac: cannot find symbol(method)
|
|
|