im totally newbie to java world and this my first 4 lines of codes and it give some error which i can’t resolve
public class MyFirstClass
{
public static void main (String[] args)
{
int x = 3 ;
String name = "Drik";
x = x * 10 ;
System.out.println("x is " + x);
}
}
when i compiled this code with javac its creating the class file
but it have output in the screen
when i write the command to compile it it give another command code without printing the result
The javac tool reads class and interface definitions, written in the Java programming language, and compiles them into bytecode class files.
To run the class file, actually print the result you want, you have to run the bytecode class with java command like