LINUKS BLOG

Make progress is the topic for ever...

My Photo
Name:
Location: China

It's a fans of computer/ Computer is my favorite/ Making progress is the topic for ever...

Sunday, February 11, 2007

Find a question

When i do the program the day before yesterday.
I find a question like this:
“This Method Has a Constructor Name” Warning in Eclipse.
The reason may be that I give a method the same name with the class.
class Sign{
public String Sign(int score){
...
}
}
The answer from the forum like this:
If you get annoyed when Eclipse alerts you about your unit tests that “This method has a constructor name”, you can set it to ignore these warnings in Window / Preferences / Java / Compiler / Error/Warnings - set “Methods with a Constructor Name” to “Ignore”.

It’s generally a bad idea to switch off warnings but in this case I think the JUnit syntax is confusing Eclipse so it’s easier to just switch them off.

0 Comments:

Post a Comment

<< Home