Ad
  • Custom User Avatar

    This is a bad practice since you are changing the original Object:

    public class valueReference{
        class Person{
          public int age;
          public Person(int years){
            age=years;
          }
        }
        public static void increment(int x) { x++; }
    
        public static void increment(Person p) { p.age++; }
    
      public static void main(String args[]){
        int a = 3;
        increment(a);
        System.out.println(a);//3
        Person pers = new Person(20);
        increment(pers)
        System.out.println(pers.age);//21
      }
    }
    
  • Custom User Avatar

    i'm getting rusty :(

  • Custom User Avatar

    The Fibonacci sequence should be explained better

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The instructions on how to calculate the fibonacci sequence are a little unclear. (n - 1) + (n - 2) appears to be some addition and subtraction. The calculation is really fib(n - 1) + fib(n - 2)

  • Custom User Avatar

    Timeout while doing test