Share on Google+Share on Google+

Sravan Kumar
How to create a Student data base using Linked List in java
2 Answer(s)      5 years and 4 months ago
Posted in : Java Beginners

I want a program by using linked list in java. The data stored must be as Records name age dob Record1 bindu 20 20feb Record2 kavya 21 4mar Record2 sandhya 22 5apr

By using linked list I hve to do that is if user asks record2 that should be display and if user don‚??t want anything it should display null

Ads

View Answers

December 21, 2011 at 3:20 PM


import java.util.*;
class StudentData
{
    String record;
    String name;
    int age;
    String dob;

    StudentData(String record, String name, int age,String dob){
        this.record=record;
        this.name=name;
        this.age=age;
        this.dob=dob;
    }
    public String getRecord(){
        return record;
    }
    public String getName(){
        return name;
    }
    public int getAge(){
        return age;
    }
    public String getDob(){
        return dob;
    }
    public static void main(String[] args) 
    {
        LinkedList<StudentData> list=new LinkedList<StudentData>();
        list.add(new StudentData("Record1","bindu",20,"20feb"));
        list.add(new StudentData("Record2","kavya",21,"4mar"));
        list.add(new StudentData("Record3","sandhya",22,"5apr"));

        Scanner input=new Scanner(System.in);
        System.out.print("Enter record no to display: ");
        String rec=input.next();
        for(StudentData data:list){
            if(data.getRecord().equals(rec)){
            System.out.println(data.getRecord()+"\t"+data.getName()+"\t"+data.getAge()+"\t"+data.getDob());
            }
        }
    }
}


June 26, 2012 at 3:48 PM


if i want to delete data than????










Related Tutorials/Questions & Answers:
How to create a Student data base using Linked List in java
How to create a Student data base using Linked List in java  I want a program by using linked list in java. The data stored must... Record2 sandhya 22 5apr By using linked list I hve
using list iterator create student details - JavaMail
using list iterator create student details  write a java program to create student class with particulars like name, rno, marks,etc. and print them... which will describe you how to create Student class and add its properties
Advertisements
stack using linked list
stack using linked list  how to implement stack using linked list
How to create a data base connectivity using sqlserver or Mydql through J2ME - JDBC
How to create a data base connectivity using sqlserver or Mydql through J2ME   hi , iam new to J2ME,i want to know, How to create a data base connectivity using sqlserver through J2ME. Currently we are working
Multiplication of two polynomials using linked list in java
Multiplication of two polynomials using linked list in java  I am doing a program "Multiplication of two polynomials using linked list in java... for polynomial linked list import java.util.Scanner; class Node { public int
write a java pogram to add elements to linked list using keyboard and display it
write a java pogram to add elements to linked list using keyboard and display it  write a java pogram to add elements to linked list using keyboard and display
Create a deque linked list of Entry Objects - Java Beginners
Create a deque linked list of Entry Objects  I need to know if I have successfully created a Square Matrix List of Entry Objects. The detail desciption and my java code solution follows: A) Description 1) The List ADT
java linked list urgent!!!
java linked list urgent!!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
java linked list urgent !!!
java linked list urgent !!!  Q1. Generate 10 thousand random integers with values in the range between 1 to 100. Q2. Store each randomly generated number into a node and then attach the node to a linked list. The list must
How to read bytes from a Linked list - Java Beginners
How to read bytes from a Linked list  i have stored byte array into a linked list. How to read the bytearray dta byte after byte from a linked list.Thanking u in advance Sameer
Core java linked list example
Core java linked list example  What is the real time example for linked list
linked list in java - Java Beginners
linked list in java  Hi, how to implement linked list in java using... information. http://www.roseindia.net/java/beginners/linked-list-demo.shtml...(); for (int i = 0; i < N; i++) { // look up a value in the list // using
Queue implementation using linked list.
Description: The advantage of using linked list is that there is no size... { int data; struct node *link; }; void insert(struct node **front, struct...;); exit(0); } temp->data = value; temp->link=NULL; if(*rear
linked list
linked list   how to add student and mark and number from file in linked list and print them also how to make search function plz can help me sooon
creating java linked list - Java Beginners
creating java linked list  how can one create a sorted linked list...("Size of list: " + queue.size()); System.out.println("Queue head using peek : " + queue.peek()); System.out.println("Queue head using element
linked list
linked list  Hi i have a problem with linked list ! how and where i can use linked list? please give me some example.   Please visit...://www.roseindia.net/java/beginners/linked-list-demo.shtml
Linked list
Linked list  what is difference btw linked list in datastructure and linked list in java
linked list
program to manage the registration details for the institute. 1. Use a linked list to manage the details of all registered students. a. Create your own linked list...linked list  Data Structures An English institute has a different
Linked list implementation
Linked list implementation  How to create linkedlist by using array in java? and also How to manipulate
HELP Generic linked list
HELP Generic linked list  How to create Generic linked list example program in Java
linked list
linked list  program for single linked list
Linked List
in the following logical linked list represents Computer Number. 76(head) 98 54...? to ?66?. The segment should also display the new contents of the linked list. ii. Write a program segment to copy all ?Dell? computers to a new linked list
linked list
linked list   how to write a program using a linked list...); System.out.println("Add elements to LinkedList: "); LinkedList<String> list=new...); } Collections.reverse(list); System.out.println("List of names in reverse order
linked list
linked list  hi i have basal problem what is the linked list
linked list example problem - Java Beginners
linked list example problem  Q: Create your own linked list (do... by repeatedly using your add function to populate a new instance of your linked list..., elem1, elem2, ‚?¶, elemN] Test your linked list in a main method which
linked list example problem - Java Beginners
linked list example problem  Q: Create your own linked list (do... by repeatedly using your add function to populate a new instance of your linked list..., elem1, elem2, ‚?¶, elemN] Test your linked list in a main method which
delete a node from singly linked list in java
delete a node from singly linked list in java  Write a program(in java), if given a pointer to a node (not the tail node) in a singly linked list, delete that node from the linked list.   could you tell your question
Tutorials   
Java Spring Hibernate Struts Training Retrieve database from the table dynamically in jsp from oracle using servlet What does core Java include? java What are some way to learn Java quickly? Is it required to learn Java before learning Java Script? Is it necessary to learn java script before learning PHP? Are HTML5 and Java Script boosts Java career? Is Java object oriented? Fingerprint application with Java Uninstall Oracle Virtual Box JSON to HashMap Free Java online Training I want example of Control Statement in Java ANSI Color Codes with Python Create a Program that Calculates Input What is difference between JDK,JRE and JVM? How to see ubuntu version on server? How to get Page Source in Selenium (WebDriver) using Java? The path to the driver executable must be set by the webdriver.gecko.driver system property parse data from a link in java Java Program Qns using BlueJ How to fix HAX Kernel Module Is Not Installed error? Installing Audacity Looking for code Logic to check track changes & Coments in MSWord, MSWordx, MSExcel, MSExcelx is ON/OFF Installing JDK on Mac SAX Parser exception ERROR 601 (42P00): Syntax error. Encountered Thread java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory How to install Ubuntu 16.04 LTS? HttpServletRequest cannot be resolved to a type in eclipse - Solved Unhandled event loop exception GC overhead limit exceeded Spring Data jpa with apache phoenix Caused by: java.lang.IllegalArgumentException: Not a host:port pair: PBUF o.a.h.h.z.RecoverableZooKeeper - Possibly transient ZooKeeper, quorum= com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager not found How to download and install Java 8 on Windows? How to uninstall JDK 7? How to install gtk-doc-tools package in Ubuntu? How to install Oracle JDK 8 on Ubuntu? ejabberd_ctl.beam not found - Solved How to convert date to UTC format in Java? How to install autoconf, automake and libtool in Ubuntu 15.10? How to convert current date to mm dd yyyy format in Java? How to convert current date to dd mm yyyy format in Java? How to stop window closing in "internalFrameClosing" event. How to find list of all index in Neo4j? neo4j-server.properties file location SASLError using PLAIN: not-authorized

Ads

 
Advertisement null

Ads