Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » referencing a class in java(referencing a class in java)
referencing a class in java [message #1712894] Thu, 29 October 2015 08:44 Go to next message
Jonathan Camilleri is currently offline Jonathan CamilleriFriend
Messages: 91
Registered: July 2009
Member
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 would also like to create a classifier algorithm, any help to kick me off would help actually.

I read tutorials at http://www.winterwell.com/software/jtwitter.php, and, http://stackoverflow.com/questions/460364/how-to-use-classes-from-jar-files.

[Updated on: Thu, 29 October 2015 08:47]

Report message to a moderator

Re: referencing a class in java [message #1712935 is a reply to message #1712894] Thu, 29 October 2015 12:59 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
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 Go to previous message
David Wegener is currently offline David WegenerFriend
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.
>>
>
Previous Topic:setting up the postgresql database with eclipse
Next Topic:why the plugins info is kept even the IDE is removed
Goto Forum:
  


Current Time: Fri Apr 26 15:27:18 GMT 2024

Powered by FUDForum. Page generated in 0.09902 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top