@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:
- 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. - You are pretending to be or have anything to do with
java.com
, which you really aren't and haven't. - Change it to something imaginary or existing. Use your own name, or your own website, I usually use
com.skiwi.*
. - 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 ofcom.skiwi.algorithms
, in which the classFibonacci
can be found.