Monday, March 24, 2014

Employee Database in java

import java.io.*;
import java.lang.*;
class employee
{
String name;
String id;
int salary;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
void get()
{
try
{
System.out.println("**********EMPLOYEE DATA**********");
System.out.println("enter the name:");
name=br.readLine();
System.out.println("enter the Id:");
id=br.readLine();
System.out.println("enter the Salary");
salary=Integer.parseInt(br.readLine());
}
catch(Exception ex)
  {
  System.out.println(ex);
  }
}
void show()
{
System.out.println("The name is:"+name);
System.out.println("The id is:"+id);
System.out.println("The salary is:"+salary);
}
}
class employ
{
public static void main(String args[])
{
employee e[]=new employee[3];
for(int i=0;i<3;i++)
{
e[i]=new employee();
}
for(int i=0;i<3;i++)
{
e[i].get();
}
for(int i=0;i<3;i++)
{
e[i].show();
}
}
}


link1: http://adf.ly/hFi7z link2: http://sh.st/qDPGc click here to download along with .class and screenshot

No comments:

Post a Comment