Computer Applications
Explain the use of import statement with an example.
Input in Java
68 Likes
Answer
import statement is used to import built-in and user-defined packages and classes into our Java program. For example, we can import all the classes present in the java.util package into our program using the below statement:
import java.util.*;
Answered By
45 Likes
Related Questions
A student was asked to write a program for computing the area of a rectangle and he, mistakenly, wrote the program to compute the perimeter of a rectangle. What kind of error is this?
Distinguish between the following:
next() and nextLine()
Distinguish between the following:
next() and next().charAt(0)
What is a java package? Give an example.