Java Import Keyword

Java Import Keyword


Import Keyword In Java
Imports keyword in Java is similar to #include<> in C programming language.
Import keyword in java is used to import classes, interfaces, or packages.
Import is a reserve keyword in java and the part of language
Hence, it will always be written in small case.
Now we will see a example -
Example -
package javaLearnings;
import java.util.Scanner;
public class Main {

  public static void main(String[] args) {
  // write your code here
Scanner ob = new Scanner(System.in);

int a, b, result;
System.out.println("enter the first number = ");
a = ob.nextInt();

      System.out.println("enter the second number = ");
b = ob.nextInt();
result = a+b;
System.out.println("the sum of the two numbers is = "+result);

  }
}
Output - The sample output would be -