• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems regarding Eclipse

 
Nitya Sundar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me?when ever i am creating a class in a project folder every time it is showing two class file(.java file) with the same name..how to resolve this problem?for example if i create class A then Eclipse is creating the same class A below it with the same name as class A.thanks in advance...
 
Amandeep Singh
Ranch Hand
Posts: 850
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it must be in different folder. Eclipse has concept of showing contents under soruce folder, plus you can the same in real folder (with different name)

Add a snapshot will illustrate your problem clearly.
 
Nitya Sundar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please bear me if any mistake i have done over here as i am new to this forum.you can see here the same Demo.java file is automatically created.and if you delete the one than the other one also get deleted.i need only single java file.
Capture.PNG
here is my snap.
[Thumbnail for Capture.PNG]
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an artifact of the way Eclipse displays source files. It lets you see the file within a directory structure (the Demo.java you have highlighted), and it also presents a view where source files are grouped by package (the Demo.java within the "(default package)" group. These are just two views of the exact same file.

I don't know why you don't also see A.java twice: it could be due to the type of project you created, or it could be due to the fact that you are creating classes without packages (which is frowned upon, you should always have a package statement as the first line of your source file.)
 
Nitya Sundar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter.I just wanted to know why it was showing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic