Hot answers tagged

3 votes

Find largest number of collinear points

Can a pair of points (i,j) yield a line that is any different to the line given by the pair of points (j,i)? Definitely not. And ...
  • 4,306
2 votes
Accepted

Functional Style if/else in java

The two versions with equivalent functionality and cleaned would be: ...
  • 3,281
1 vote

FileIO lines to String Converter

Where's your javadoc? createFile() is misleadingly named. It does not create a file. Similarly, setLength() and ...
  • 1,423
1 vote

Functional Style if/else in java

I agree, that the second one is more readable. It is obviously just less amount of lines and characters. Things can change if it was more complicated example. Also the first one is a lot nicer in ...
  • 2,146
1 vote

Printing a Hollow Butterfly pattern

Any single-letter variable name is usually a mistake. Give variables meaningful names, even in simple exercises. I take it that i is line number and ...
  • 1,423
1 vote

Printing a Hollow Butterfly pattern

Apart from what is already mentioned, I want to bring out 2 points/good practices: Even if you are printing something, it's good to construct the whole string at once and then print it. That way you ...
  • 2,146

Only top scored, non community-wiki answers of a minimum length are eligible