How to use import in programs ? plz explain it! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to use import in programs ? plz explain it!

Import

6th Aug 2016, 2:25 PM
prem sahu
prem sahu - avatar
3 Answers
+ 1
import is a keyword that is used to import packages in programs eg:- a user want to take input from user by keyboard so he import package import java.io*;
6th Aug 2016, 4:13 PM
sachin tomar
sachin tomar - avatar
+ 1
import is a keyword in java which means to import something e.g to take input from user you have to import java.util.Scanner;
6th Aug 2016, 5:26 PM
Toffiq Saddique
0
Packages are collections of useful functions a programmer might like to use instead of making their own. To use a package they import it into the program using the keyword 'import', then they type the package itself. Packages may contain many useful functions so it may be necessary to only reference one import item. The coder would then type in the import keyword then the name of the tool they wish to use. However if a coder wished to import the entire package they can use a * to reference all tools in that package. for example. below might be the full package name for a tool. import java.awt.2dgraphics. Below would reference all packages in the Java awt library. import java.awt.* The * means look for and use all items in the package. Java import statements are stated at the beginning of a class file.(I haven't done java in 5 years so these package names are likely wrong.)
7th Aug 2016, 1:26 AM
Mi You