Home » Newcomers » Newcomers » referencing a class in java(referencing a class in java)
|
Re: referencing a class in java [message #1712935 is a reply to message #1712894] |
Thu, 29 October 2015 12:59 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Jonathan,
Your import is of a package but imports are for importing classes, so
add a .* to import all the classes from that package (bad style in my
opinion) or import a specific class. Also, using an upper case name
for your package is also very bad style and will be completely confusing
to anyone looking at your code.
http://www.oracle.com/technetwork/java/codeconventions-135099.html
Note that Ctrl-Space does auto completion and will create imports
automatically. That's the better way.
On 29/10/2015 9:44 AM, Jonathan Camilleri wrote:
> Can someone remind me how to reference the class in the screenshot and why my statement is not working, please?
>
>
> import net.sf.javaml.classifiction;
> package LoadFromFile;
>
> public class Classifier {
>
> }
>
>
> Libraries at http://java-ml.sourceforge.net/, and, http://www.datathief.org/.
> I am using Eclipse Mars.
>
> I read tutorials at http://www.winterwell.com/software/jtwitter.php, and, http://stackoverflow.com/questions/460364/how-to-use-classes-from-jar-files.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: referencing a class in java [message #1713029 is a reply to message #1712935] |
Thu, 29 October 2015 23:46 |
David Wegener Messages: 1445 Registered: July 2009 |
Senior Member |
|
|
It also helps to check your spelling.
On 10/29/2015 07:59 AM, Ed Merks wrote:
> Jonathan,
>
> Your import is of a package but imports are for importing classes, so
> add a .* to import all the classes from that package (bad style in my
> opinion) or import a specific class. Also, using an upper case name
> for your package is also very bad style and will be completely confusing
> to anyone looking at your code.
> http://www.oracle.com/technetwork/java/codeconventions-135099.html
>
> Note that Ctrl-Space does auto completion and will create imports
> automatically. That's the better way.
>
>
> On 29/10/2015 9:44 AM, Jonathan Camilleri wrote:
>> Can someone remind me how to reference the class in the screenshot and
>> why my statement is not working, please?
>>
>>
>> import net.sf.javaml.classifiction;
>> package LoadFromFile;
>>
>> public class Classifier {
>>
>> }
>>
>>
>> Libraries at http://java-ml.sourceforge.net/, and,
>> http://www.datathief.org/.
>> I am using Eclipse Mars.
>>
>> I read tutorials at http://www.winterwell.com/software/jtwitter.php,
>> and,
>> http://stackoverflow.com/questions/460364/how-to-use-classes-from-jar-files.
>>
>
|
|
|
Goto Forum:
Current Time: Fri Apr 26 15:27:18 GMT 2024
Powered by FUDForum. Page generated in 0.09902 seconds
|