public static void main(String[] args) {
ClassStudentName c = new ClassStudentName();
Scanner s= new Scanner([Link]);
char y='y';
char y1='y';
int choice;
while(true){
[Link]("\t \t THIS IS A PROGRAM FOR CLASS STUDENT NAMES
MANAGEMENT\n ");
[Link]("\t [Link] ADD a Student name press 1. \n\t [Link] UPDATE or
MODIFY a Student name press 2. \n\t [Link] REMOVE a Student name press 3. \n\t [Link]
SEE the Student names press 4.\n");
choice= [Link]();
[Link]();
switch(choice){
case 1:
while(true){
[Link]("Enter the Student name in the format:
ROLL_NUMBER. NAME: ");
String Name= [Link]();
[Link](Name);
[Link]("Do you want to continue adding names?(Enter
n to exit or Enter any other key to continue):");
y1=[Link]().charAt(0);
[Link]();
if(y1=='n')
break;
}
break;
case 2:
[Link]("Enter the Roll Number of the Student whom do
you want to modify: ");
int roll = [Link]();
[Link]();
[Link]("Enter the Name of the New Student:");
String Name= [Link]();
[Link](roll, Name);
break;
case 3:
[Link]("Enter the Roll Number of the Student to
Delete:");
int roll1= [Link]();
[Link](roll1);
break;
case 4:
[Link]();
break;
default:
[Link]("Enter Properly!!");
}
[Link]("DO YOU WANT TO CONTINUE WITH THIS PROGRAM? (Enter n to
exit or Enter any other key to continue):");
y= [Link]().charAt(0);
[Link]();
if(y=='n')
break;
}
public class ClassStudentName {
private ArrayList<String> classname = new ArrayList<String>();
public void AddStudentName(String Name){
[Link](Name);
}
public void PrintStudentName(){
int n= [Link]();
[Link]("Your Class has "+ n + " number of students.\n"+
"Students name along with their Roll Numbers:");
for(int i=0;i<n;i++){
[Link]((i+1) +" " +[Link](i));
}
}
public void UpdateStudentName(int pos, String Name){
[Link](pos-1, Name);
[Link]("Name has been Modified or updated.\n");
}
public void DeleteStudentName(int pos){
[Link](pos-1);
[Link]("Name has been Deleted Successfully.\n");
}