public class Main {
public static void main(String[] args) {
Library.x = 20;
Library.show();
Library.change();
Library.show();
}
}
class Library {
public static int x;
public static void show() {
System.out.println("x = " + x);
}
public static void change() {
x++;
}
}
public class Main {
public static void main(String[] args) {
Library.setX(20);
Library.show();
Library.change();
Library.show();
}
}
class Library {
private static int x;
public static void show() {
System.out.println("x = " + x);
}
public static void change() {
x++;
}
public static void setX(int x) {
Library.x = x;
}
}
What would happen, if we change "Library.x" to just "x"?
Create a new method in new class, that prints something.
Create piggy bank class. How it works?
Create an usage example (i.e. in main method).
Create a new class called Statistics.
The class should:
Watch https://www.youtube.com/watch?v=SkP2VBzgpKA.
Create a program, that helps solving problems like the one present on video using recursion.