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 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
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????
Ads
Related Tutorials/Questions & Answers:
Advertisements
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
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
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
Linked list what is difference btw
linked list in datastructure and
linked list in
java
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
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 hi i have basal problem what is the
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
How to create new arraylist using Java
How to
create new arraylist
using Java hi,
I want to develop... someone provides online example
how to
create new arraylist in
java programming.
thnaks,
Hi,
In
java programming language you can
create new