SHARE
TWEET

Untitled

sd_captain Oct 16th, 2019 93 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;
  2.  
  3. public class Main
  4. {
  5.     public static void main(String[] args) {
  6.        
  7.     Map <String, String> studentlist = new HashMap<>();
  8.     Map <String, Integer> studentlist1 = new HashMap<>();  
  9.     Scanner input = new Scanner(System.in);
  10.    
  11.     System.out.print("Enter student number 1: ");
  12.     int student1 = input.nextInt();  
  13.     studentlist1.put("S1", student1);
  14.    
  15.     System.out.print("Enter first name 1: ");
  16.     String studentname1 = input.next();  
  17.     studentlist.put("SN1", studentname1);
  18.    
  19.     System.out.print("Enter student number 2: ");
  20.     int student2 = input.nextInt();  
  21.     studentlist1.put("S2", student2);
  22.    
  23.     System.out.print("Enter first name 2: ");
  24.     String studentname2 = input.next();  
  25.     studentlist.put("SN2", studentname2);
  26.    
  27.     System.out.print("Enter student number 3: ");
  28.     int student3 = input.nextInt();  
  29.     studentlist1.put("S3", student3);
  30.    
  31.     System.out.print("Enter first name 3: ");
  32.     String studentname3 = input.next();  
  33.     studentlist.put("SN3", studentname3);
  34.    
  35.     System.out.println("Student List:");
  36.     System.out.println(studentlist1.get("S1") + studentlist.get("SN1"));
  37.     System.out.println(studentlist1.get("S2") + studentlist.get("SN2"));
  38.     System.out.println(studentlist1.get("S3") + studentlist.get("SN3"));
  39.        
  40.     }
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top