+ 1

Hey guys can you explain what does import.java and some confusing stuff like this mean in java or if you guys have got any link

16th Mar 2018, 8:21 AM
Devansh Gupta
Devansh Gupta - avatar
5 Antworten
+ 11
for example U want to use Scanner object for taking user input , then u first need to import Scanner class .. ie import java.util.Scanner; //at the beginning of program now U can make object of it ... Scanner sc=new Scanner (System.in);
16th Mar 2018, 8:40 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 3
Importing is necessary in order to use the classes you wrote yourself or to use the standard Java library.
16th Mar 2018, 8:24 AM
Aidos Zhakupov
Aidos Zhakupov - avatar
+ 3
For example, you wrote a class in which there are methods that simplify the syntax of System.out.println and it is located in another package. In my case it is called Print. In order to use it in another package I import it via import. import static MyJava.Print. *
16th Mar 2018, 8:32 AM
Aidos Zhakupov
Aidos Zhakupov - avatar
+ 2
thanks man but I am new here you can understand . but the point is I did not understand
16th Mar 2018, 8:37 AM
Devansh Gupta
Devansh Gupta - avatar
+ 1
little more details please
16th Mar 2018, 8:27 AM
Devansh Gupta
Devansh Gupta - avatar