Sunday, 8 September 2013

java program for student details

import java.io.*;

class Student{

public static void main(String args[]){

    InputStreamReader is = new InputStreamReader(System.in);
    BufferedReader br = new BufferedReader(is);
   
    System.out.print("Welcome to java");
   
    try{
   
        System.out.println("Enter Student Name:");
       
        String Name = br.readLine();
       
        System.out.println("Enter Student Number:");
       
        String No = br.readLine();
       
        System.out.println("Enter Student class:");
       
        String Clas = br.readLine();
   
    System.out.println(" Hi "+Name +" your no is: "+ No +", you are studying "+Clas +"!");
        }
       
    catch (IOException Err) {
   
    System.out.print("Error in reading Line!");
    }
   
    catch(NumberFormatException Err){
    System.out.print("Error in Number format conversion!");
    }

    }
}