Created
July 25, 2012 17:01
-
-
Save madankumarpc/3177265 to your computer and use it in GitHub Desktop.
Groovy introduction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.learn.first | |
class HelloWorld { | |
static void main(args) | |
{ | |
println "hello world"; | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.learn.first | |
public class HelloWorld { | |
public static void main(String args[]) | |
{ | |
System.out.println("hello world"); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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