Sachin Muthumala :
I want to compile and run in the single command line. Usually, we first compile and after the run?
javac example.java
java example
can I run this,
javac example.java && java example
kadar :
You can use a function :
Myfunction() { javac $1.java && java $1 ; }
The use :
Myfunction example
This question is duplicated , please to search before posting See : Compile and build with single command line Java (Linux)
Regards