You're developing a Java application that needs to work with .jar files. When running the application, it should accept the file name of the .jar file as an argument and display its name. The relevant code snippet has been provided below, but it contains a number of blanks that need to be filled in. Can you complete the code?
JAR files
Completing code to display jar file name
Report a typo
Fill in the gaps with the relevant elements
import java.util.jar.*;
public class ArchiveDemo {
public static void (String[] args) throws Exception {
jarFile = new JarFile(args[0]);
System.out.println("Jar file: " + jarFile.getName());
}
} ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.