Do I put it after the package name? Also, so I put the classes in the import sta
ID: 3709682 • Letter: D
Question
Do I put it after the package name? Also, so I put the classes in the import statements I have in the Class List? Please help me on this. I have provided a photo below. Thank you in advance ile name: 1.java // Author: // Date: // Purpose: 5 // Class list: 7 package cst8284.triviatime; 9 import javafx. stage.Stage; ?0 1 import javafx.stage.FileChooser; ?2 import javafx.stage.FileChooser.ExtensionFilter; 13 import java.io.File; 14 import java.io.FileInputStream; 15 import java.io. IOException; 16 import java.io.ObjectInputStream; 17 import java.util.Arraylist; 18
Explanation / Answer
The package name should be in the top and all the packeges to be imported should come after that.
In order to import a class from the package, use
import package_name.class_name;
Your import statements are correct.
In order to import a specific class, after import first write the packag name, and then the class name which you want to import.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.