Groovy web console

subscribe to the feed Subscribe
to this
site
Java (via #groovywebconsole)
tweet this snippet Tweet
this
script

Java

Published 3 months ago by SagarGiri with tags java constructor
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
public class A {
    public A(){
        System.out.println("A Constructor");
    }
    
    public void doSomething(){
        System.out.println("Something");
    }

    public int getOne(){
        return 1;
    }

    public static void main(String[] args){
        A a = new A();
        a.doSomething();
        System.out.println("getOne() ==>" + a.getOne());
    }
}