• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot be resolved into a type error message  RSS feed

 
Foni kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Experts,

I am getting the error message as Exception in thread "main" java.lang.Error: Unresolved compilation problems: NewExcel cannot be resolved to a type for the line NewExcel test = new NewExcel(); in the below code to read the columns from an excelsheet "test.xls". Can someone suggest me why I am getting the error message :-



Thanks and Regards
Debashis
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Foni kumar wrote:Can someone suggest me why I am getting the error message :-

Yes. Because the compiler doesn't know what a NewExcel is. Is it a class from a library? Or one that you wrote yourself? Either way, if it's not in the same package as your ReadExcel class, you'll have to add an 'import' statement for it.

Winston
 
Foni kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston Gutkowski wrote:
Foni kumar wrote:Can someone suggest me why I am getting the error message :-

Yes. Because the compiler doesn't know what a NewExcel is. Is it a class from a library? Or one that you wrote yourself? Either way, if it's not in the same package as your ReadExcel class, you'll have to add an 'import' statement for it.

Winston


Thank-you for your suggestions. Can the below change help, please correct me if I am getting it wrong. As I have declared the classname as NewExcel.

 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried compiling and running it to see what happens?

BTW are you sure your NewExcelNewExcel test = new NewExcel(); line shouldn't just be:

I ask because your text object seems to be calling methods that are in the ReadExcel class.
 
Foni kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tony Docherty wrote:Have you tried compiling and running it to see what happens?

BTW are you sure your NewExcelNewExcel test = new NewExcel(); line shouldn't just be:

I ask because your text object seems to be calling methods that are in the ReadExcel class.


I think you guys are right. I will try to compile after making the changes and will post then.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!