Skip to main content
1 of 2
skiwi
  • 10.6k
  • 6
  • 44
  • 108

@Vogel612 has already mentioned all major defects and areas of improvement in your code. I want to talk about one more thing:

Your package naming is horrible. You are using com.java.fib, please do not ever do that again, because:

  1. Although Java classes are prefixed with java.*, it still creates confusion as people might think this is a library class. In extreme cases when you use professional names, it might even lead to a name clash.
  2. You are pretending to be or have anything to do with java.com, which you really aren't and haven't.
  3. Change it to something imaginary or existing. Use your own name, or your own website, I usually use com.skiwi.*.
  4. Even com.skiwi.fib would be horrible because it offers barely any extra information, com.java.fib.Fibonacci is not helpful, consider something along the lines of com.skiwi.algorithms, in which the class Fibonacci can be found.
skiwi
  • 10.6k
  • 6
  • 44
  • 108