AF
Home
Tag
Submit Notes
Ask Anything
Login
Subscribe Us
A
ny
F
orum
1. Feel Free to ask and submit anything on Anyforum.in and get satisfactory answer
2. Registration is not compulsory, you can directly login via google or facebook
3. Our Experts are looking for yours ?.
Follow @anyforumin
corejava-basics: Is Empty java file name a valid source file name ?
May i save a java file without any name ? as .java only. would it work properly ?
corejava x 353
basics x 171
Posted On :
2013-11-19 22:22:44.0
Rishi Kumar
523
1882
50048
5
Answers
Yes, you can save your java file by .java only, compile it by javac .java and run by java yourclassname
Let´s take a simple example:
//save by .java only
class AnyForum{
public static void main(String args[]){
System.out.println("Hello anyforum.in");
}
}
compile it by javac .java
run it by java AnyForum
Posted On :
2013-11-19 23:00:42
Satisfied :
2 Yes
0 No
Garima Gupta
596
1295
60202
Reply This Thread
5
Post Answer
Please Login First to Post Answer:
Login
Answer:
anyforum.in