i have a class called FilterTraps . can i have a method called filterTraps in it? is it according to java code conventions. please say yes or no. don't give me java code conventions document
Michael Dunn
Rancher
Joined: Jun 09, 2003
Posts: 4041
posted
3
> i have a class called FilterTraps . can i have a method called filterTraps in it?
Mohan Mehra wrote:please say yes or no. don't give me java code conventions document
That's a really bad attitude. It's far better to point you at the appropriate documentation and let you do some research on your own than to just hand you an answer.
Note that while Jesper's example "works", it does break Java conventions because it uses a method and a variable starting with an upper-case letter. Which shows there's a difference between what you can do and what you should do. The compiler doesn't try and enforce convention.
Your initial example doesn't break the convention because you've got the cases right. Someone who's used to the conventions will be able to tell the difference easily. Whether it's a good idea depends on whether "FilterTraps" is a good name for the class and the method. I'm a bit doubtful, but it depends on what they do - it might be perfectly sensible.