A question about file format | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 8

A question about file format

What file format is used for saving runnable written Java code files?

2nd Apr 2018, 10:12 AM
Ibaadi Jaya
Ibaadi Jaya - avatar
9 Answers
+ 7
Thank you for the feedback : )
2nd Apr 2018, 12:24 PM
Ibaadi Jaya
Ibaadi Jaya - avatar
+ 6
.java absolutely
2nd Apr 2018, 11:16 AM
Arushi Singhania
Arushi Singhania - avatar
+ 6
KayDee You can compress several files in a .zip file for sharing e.t.c. Likewise many .java files are compressed together in a .jar file.
2nd Apr 2018, 11:27 AM
Arushi Singhania
Arushi Singhania - avatar
+ 4
Actually at first the java file has an extension ".java" but after compilation using "javac" command a ".class" file is created. Which is executed when we use "java" command in the terminal and this .class file can further be packaged to create a .jar file. Which is platform independent. One can also create a windows executable ".exe" from ".jar" file using LAUNCH4J but this would be platform specific , hence not recommended. I hope you understood. *Applies mostly to JAVA SE version.
2nd Apr 2018, 8:19 PM
SatyaJit Pradhan
SatyaJit Pradhan - avatar
+ 3
.java i think?
2nd Apr 2018, 10:31 AM
Kshitij Dhama
Kshitij Dhama - avatar
+ 3
Arushi Singhania then what does .jar defines?
2nd Apr 2018, 11:18 AM
Kshitij Dhama
Kshitij Dhama - avatar
+ 3
Arushi Singhania I googled it! .jar stands for Java ARchive.
2nd Apr 2018, 11:27 AM
Kshitij Dhama
Kshitij Dhama - avatar
+ 3
.java files are the source code files. When they are compiled, they are stored as .class files and can be compressed into a single executable .jar archive.
2nd Apr 2018, 4:00 PM
Moritz Vogel
Moritz Vogel - avatar
+ 1
Java "executables" are either .class or .jar files. It's common to deliver a script (.bat file for Windows) with a Java program to run it.
10th Apr 2018, 4:52 AM
Pooja Singh
Pooja Singh - avatar