• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem using javac: cannot find symbol(method)

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

If you want to instantiate an object, you should use the "new" operator.

Henry
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic