Skip to content

Instantly share code, notes, and snippets.

@madankumarpc
Created July 25, 2012 17:01
Show Gist options
  • Save madankumarpc/3177265 to your computer and use it in GitHub Desktop.
Save madankumarpc/3177265 to your computer and use it in GitHub Desktop.
Groovy introduction
package com.learn.first;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ExecuteProcess {
public static void main(String[] args) {
try
{
Process proc=Runtime.getRuntime().exec("cmd /C dir");
BufferedReader br=new BufferedReader(new InputStreamReader(proc.getInputStream()));
String line;
while((line=br.readLine())!=null)
{
System.out.println(line);
}
}
catch(IOException iox)
{
iox.printStackTrace();
}
}
}
package com.learn.first
class HelloWorld {
static void main(args)
{
println "hello world";
}
}
package com.learn.first
public class HelloWorld {
public static void main(String args[])
{
System.out.println("hello world");
}
}
package com.learn.first
class HelloWorlParam {
static void main(args)
{
println " " + args;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment