Share on Google+Share on Google+

1 Answer(s)      6 years and 4 months ago
Posted in : HTML

Write a program to store information of 10 employees and to display of an employee depending upon the employee no given by the user using structure

View Answers

January 27, 2011 at 4:45 PM

Hi Friend,

Try this:

import java.util.*;

class  Information{
    int no;
    String name;
    String address;
    int contactNo;
    Information(int no,String name,String address,int contactNo){;;
    public int getNo(){
        return no;
    public String getName(){
        return name;
    public String getAddress(){
        return address;
    public int getContactNo(){
        return contactNo;
    public class EmployeeInformation{
    public static void main(String[] args){
        ArrayList<Information> list=new ArrayList<Information>();
        Scanner input=new Scanner(;
        for(int i=0;i<4;i++){
            System.out.println("-----Employee "+(i+1)+"-----");
            System.out.println("Enter empno: ");
            int no=input.nextInt();
            System.out.println("Enter name: ");
            System.out.println("Enter address: ");
            System.out.println("Enter contact no: ");
            int contactno=input.nextInt();
            list.add(new Information(no,name,address,contactno));
System.out.println(" ");
System.out.print("Enter Employee Id: ");
int id = input.nextInt();
for(Information s : list){
if(id == s.getNo())
System.out.print(s.getName()+" " +s.getAddress()+" "+s.getContactNo());



Related Tutorials/Questions & Answers:
project  suggest a network security project based on core java with explanation
project  i need a project in java backend sql
PROJECT  i want online polling system project codding
project  sir i want a java major project in railway reservation plz help me and give a project source code with entire validation thank you
project  sir i want module and source code on my project hospital management system
project  does hostel management system project contain any dynamic web pages
PROJECT  i want help on making project on mobile banking application..... the application should have SAVING ACCOUNT,CURRENT ACCOUNT,TRANSACTION ETC......... IN APPLICATION
project  i have to do my final year project project topic:Weekly Automatic College Timetable Generation System BRIEF EXPLANATION ABOUT PROJECT This project takes various inputs from the user such as Teacher List, Course List
project  sir i want to a project on railway reservation,sir plz give me the source code   plz give me the source code of railway reservation
project   hi , we r working on one project related to our results. we using java and for back end sqlserver 2005. In dis we are trying to retrieve result from some site and store it in our data base so that we can perform
project  For my project their is 2 users, one is users and administers.i want code for giving authentication to these users by using one, means same login form and database table back end is mysgl....and am using wamp sever
Project  Hi, Am starting a new project to draw a 2d graph using java swing and opengl,where in the input for X-axis and Y-axis co=ordinates should be accepted from user... As am very new to this am seeking help so pls help
project..  Write a program to find the result of N students by accepting 5-subject marks from a Mark class and calculate the total and average mark. Display the result of all students in ascending order of rank from Result class
Project  &lt;% String project no=request.getParameter("project no"); String qry="select stud name,project name,project type,project...(receipt dt,'dd/mm/yyyy') from proj master "; qry+=" where project
project  I'm designing a netbeans java program/project. I have to design a program that captures the persons name and mark #.then find the average mark of the whole class.after that need to count and display who had the highest
project...   enter 10 integers, store it using array then display them from highest to lowest. 2.enter 10 integers, store it using array then display them from lowest to highest number to words conversion create a java program
Project  How to show Questions randomly so that no two student get the same questions in online examination system project in Java Server Pages  
=(String) vdata.get(1); String project_name=(String) vdata.get(2); String project
project enquire
project enquire  **hi admin, are you had project about "project tracking" on java
Project Management
Project Management  What is Project Management and how it useful in managing a software project. What all certification courses are available for Software Project Management? How to become a good project manager? Thanks
Regarding Project
Regarding Project  sir, i am doing a project in java. my project is CITY GUIDE it is an web application. please give me documentation of my project
Regarding Project
Regarding Project  sir, i am doing a project in java. my project is CITY GUIDE it is an web application. please give me documentation of my project
project query
project query  I am doing project in java using eclipse..My project is a web related one.In this how to set sms alert using Jsp code. pls help me
mini project
mini project  I want a mini project on eco tourism
Project Doubght
Project Doubght  What is meant by server monitoring in java enterprise application
Need Project
Need Project  How to develop School management project by using Struts Framework? Please give me suggestion and sample examples for my project
[Mini-Project]  [Mini-Project] Develop a programmer's editor in Java that supports syntax highlighting, compilation support, debugging support, etc
java project
java project  i would like to get an idea of how to do a project by doing a project(hospital management) in could you please provide me with tips,UML,source code,or links of already completed project with documentation
Project in jsp
Project in jsp  Hi, I'm doing MCA n have to do a project 'Attendance Consolidation' in JSP.I know basic java, but new to jsp. Is there any JSP source code available for reference...? pls help me
Java Project
Java Project  Java project using with collection and generic with observer design pattern
project description
project description  Hi Sir, i want to ask question how to describe web project in interview. i did work on some project and role was the application development such as (login,register validation etc)and time of project was 3
Java Spring Hibernate Struts Training How to Word-wrap in an HTML table? I'm trying to pass counter data to another HTML page. How to display button as a link in vaadin? hi change navbar dropdown color in bootstrap How to remove the background color of bootstrap menu bar? How to change color of opened Bootstrap drop down toggle? Setting bootstrap container background color Help school all activities and admision process.. add one row after another date make a webpage HTMl HTMl Source code how to apply globalisation to a world wide application how to print HTML using javascript or Jquery How to recover from google panda update? How to survive google panda 4.0 update How to find if you have been hit by Panda 4.0 Design a web page using XHTML and JavaScript that does the followings: ffmpeg converting file mp4 to mov JavaScript How to Disable Catch-all Emails on CPanel z-index always on top What is Web hosting Database and HTML web development trainee Uploading files Image Gallery Image Gallery dropdown How to redirect from a HTML page? Easiest method for expiring the css and js headers HTML WITH AJAX VB 6 Read Web Page Header string palindrom using vbscript? html button How to add mod_deflate to apache without recompiling How to use place hoder in IE(version : 8) Html Software Question div align left css Fetching data from excel file on other website and display in interactive graph form where do I find the fix for tree view catalog not expanding and collapsing correctly for roseindia shopping cart 1.1 pass to next page to enter into a particular page only if the username,password and listbox value mtches hi Cricket stadium ticket booking design Need some help creating an order form.


Advertisement null