Difference between java class and jar

后端 未结 4 1462
南笙
南笙 2021-01-30 20:44

What is the difference between a java class file and a jar file?

相关标签:
4条回答
  • 2021-01-30 20:50

    A Jar file is an Zip archive containing one or multilple java class files. This makes the usage of libraries (consisting of multiple classes) more handy. Directories and Jar files are added to the classpath and available to the ClassLoader at runtime to find particular classes inside of it.

    0 讨论(0)
  • 2021-01-30 20:50

    JAR file is the compressed file format. You can store many files in a JAR file. JAR stands for the Java Archive. This file format is used to distribute a set of java classes. This file helps you to reduce the file size and collect many file in one by compressing files

    a Class is explained here

    0 讨论(0)
  • 2021-01-30 20:53

    A JAR file has many files into it. We generally use .jar files to distribute Java applications or libraries, in the form of Java class files and associated metadata and resources (text, images, etc.). you can say JAR = Java ARchive.

    All java files are compiled into class files and then we use that class file not the .java file. A class is a construct that is used as a blueprint to create instances of the class.

    See Wikipedia for more information: Wikipedia for JAR and Wikipedia for class

    0 讨论(0)
  • 2021-01-30 21:04

    A java file contains Java code. A Java file is compiled to produce a class file that can be loaded by the JVM. The contents of a class file are rather well explained here. A Jar file is an archive of otherfile, most likely class files.

    0 讨论(0)
提交回复
热议问题