saykotislam

201-15-13993_l-fianl

Apr 12th, 2021 (edited)
67
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package labfianl;
  2. import java.util.Scanner;
  3.  
  4. class Cricket {
  5.     String name;
  6.     int j_num;
  7.     int age;
  8.     int n_m;
  9.    
  10.     public Cricket(String name, int j_num,int age, int n_m){
  11.         this.name=name;
  12.         this.j_num=j_num;
  13.         this.age=age;
  14.         this.n_m=n_m;
  15.     }
  16.    
  17.     public void Batsman(){
  18.    
  19.     }
  20.    
  21.     public void Bowler(){
  22.        
  23.     }
  24.    
  25.     public void Keeper(){
  26.        
  27.     }
  28.    
  29.     public void Allrounder(){
  30.        
  31.     }
  32.    
  33.     void dis(){
  34.         System.out.println("Name: "+name);
  35.         System.out.println("Jersey No: "+j_num);
  36.         System.out.println("Age: "+age);
  37.         System.out.println("Matches: "+n_m);
  38.     }    
  39. }
  40.  
  41.  
  42. public class Team {
  43.     public static void main(String[] args) {
  44.         Scanner n=new Scanner(System.in);
  45.         String nm;
  46.         int x,y,z;
  47.        
  48.         System.out.println("Player Name: ");
  49.         nm=n.nextLine();
  50.        
  51.         System.out.println("Player jersey: ");
  52.         x=n.nextInt();
  53.        
  54.         System.out.println("Player age: ");
  55.         y=n.nextInt();
  56.        
  57.         System.out.println("Played matches: ");
  58.         z=n.nextInt();
  59.        
  60.         Cricket cric=new Cricket(nm,x,y,z);
  61.         cric.dis();
  62.     }
  63. }
  64.  
  65.  
  66.  
RAW Paste Data