Skip to content

Instantly share code, notes, and snippets.

@siguremon
Created October 7, 2013 10:13
Show Gist options
  • Save siguremon/6865532 to your computer and use it in GitHub Desktop.
Save siguremon/6865532 to your computer and use it in GitHub Desktop.
JavaToGroovy
class HelloWorld {
private String name
void setName(String name) {
this.name = name
}
String getName() {
return name
}
String greet() {
return "Hello " + name
}
static void main(String[] args) {
HelloWorld helloWorld = new HelloWorld()
helloWorld.setName("Groovy")
System.out.println( helloWorld.greet() )
}
}
public class HelloWorld {
private String name;
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
public String greet() {
return "Hello " + name;
}
public static void main(String[] args) {
HelloWorld helloWorld = new HelloWorld();
helloWorld.setName("Groovy");
System.out.println( helloWorld.greet() );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment