Java
T
point
Home
Core Java
Servlet
JSP
Struts2
Mail API
Hibernate
Spring
Android
Design Pattern
Projects
Interview Q
View All Questions
Ask New Question
can we run or compile a java file without a class name ?
By:
patil.***
On:
Sat Apr 07 17:39:17 IST 2018
0
0
0
0
Example: filename : sample.java
class {
System.out.println("Hello");
}
if I run => java sample.java
it will compile or not ?
0
core java x
328
Tags
Yes,
you can compile a java file without classname by using javac .java but you can't run a java program without classname.
0
By:
[email protected]
On:
Sun Apr 08 12:57:02 IST 2018
0
0
0
0
Are You Satisfied :
0Yes
0No