+ 5
How to compile java program using Runtime class?
suppose I write a Java program Hello.java how can I compile and execute it with the help of Runtime class?
10 odpowiedzi
+ 3
public class GFG
{
public static void main(String[] args)
{
// get the current runtime assosiated with this process
Runtime run = Runtime.getRuntime();
// print the current free memory for this runtime
System.out.println("" + run.freeMemory());
}
}
+ 3
@ ahmet samet baltaci i do not want to run program by using command prompt. I want to write a Java code that is used for executing Java code.
+ 3
@anisha
thank u Ji..aur ye hi bat tumari HTML k liye... :)
+ 3
@anisha
abi KB tak hain tumare exam??
+ 3
@anisha
okie WhatsApp b off h tab tak tumara??
+ 3
@anisha
hehe aley..Mene wtsapp num dala tha code me kisi ka reply ni aya to code hi remove kr diya..
+ 3
goddiieenightt Ji :)
+ 1
use netbeans to run your javaprograms
0
Hi
First of all go to app path on terminal(Hello.java) after then write "javac Hello.java" this code compile your app and if this statement is true write "java Hello.java"
0
sahi hai !!!!