dm6801

20171109 - 03 - classEx_01

Nov 11th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. package myApp;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class class03_01 {
  6.  
  7.     public static void main(String[] args) {
  8.         //init vars
  9.         int n = 0;
  10.        
  11.         //usage msg
  12.         System.out.println("Integer: ");
  13.        
  14.         //open in_Stream, parse & close
  15.         Scanner s = new Scanner(System.in);
  16.         n = s.nextInt();
  17.         s.close();
  18.        
  19.         //output n , n^2
  20.         System.out.printf("%d , %d", n, n*n);
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment