Computer Science, asked by Fact353535, 1 year ago

how will you import a scanner package

Answers

Answered by ayush288
1
import java.util.Scanner;
Answered by franktheruler
0

Answer:

According to the question " import java.util.Scanner " is a correct answer.

Explanation:

In java, scanner package is used for taking input from user. Create an object of scanner class  to take input from user.

Example of scanner package :

 import java.util.Scanner

 class java

{

   int a, b ;

   scanner sc = new scanner ( system . in )

   system. out . println ( " enter the two numbers ") ;

   a = sc . nextInt ( ) ;

   b = sc . nextInt ( ) ;

    int add ( )

    {

       return ( a + b ) ;

    }

 public static void main ( string args [ ] )

{  

    java obj = new java (  ) ;

    obj . add ( ) ;

}

}

Similar questions