Clovek

Run Settings
LanguageJava
Language Version
Run Command
class Clovek { private static int counter = 0; private String name; private int age; Clovek(String name, int age) { this.name = name; this.age = age; Clovek.counter += 1; } public static int getCounter() { return Clovek.counter; } public String getName() { return this.name; } public int getAge() { return this.age; } public void whoami() { System.out.println("Hello, my name is " + this.name + ". I am " + this.age + " years old."); } } class Main { public static void main(String[] args) { Clovek dan = new Clovek("Daniel", 31); dan.whoami(); System.out.println("People counter: " + Clovek.getCounter()); } }
Editor Settings
Theme
Key bindings
Full width
Lines