JAVA SP T


Lets dive into snapshot of my programs!💻

8.Enter the long integer from user using Scanner class

💡Code:

              import java.util.Scanner;
              //Enter the long integer from user using Scanner class
              class LongUsingScanner7078 
              {
                public static void main(String[] args) 
                {
                  Scanner sc = new Scanner(System.in);
                  System.out.println("Enter a long integer : ");
                  long l = sc.nextLong();
                  System.out.println("long integer is : "+l);
                  
                }
              
              }
               

📸Output :

output