Reputation: 51
This is the Question asked in one of the interview... Usually in eclipse we write class after creating a java project. Is it possible to have a class without a java project?
Upvotes: 3
Views: 1647
Reputation: 9
Yes, What you need to do is do FILE ---> New Class -----> (The type the class name). Then add that to a Java Project. Any more question Ask my profile
Upvotes: 0
Reputation: 23
Eclipse essentially does require you to create a project and put your Java source code into it.
It's actually possible to just use File | Open... to open a Java file and edit it, but the editor will have reduced functionality; it will act more like a plain text editor and won't be able to help you write code and find errors the way the full editor can.
Upvotes: 1
Reputation: 697
There is no way of creating a class in Eclipse without creating a project first. I am sure you will know how to create a new project but just in case:
File -> New -> java project
Upvotes: 3