Uhh, hello. I just want to get a sample line of codes that displays the given string, insert a new element and deletes an old element. So far, this what I have done:
import java.io.*;
public class EmpLists {
String employees[] = {"A", "B", "C", "D", "E" };
}
class CallEmpLists {
public static InputStreamReader r = new InputStreamReader (System.in);
public static BufferedReader inp = new BufferedReader(r);
public static void main (String args[]) throws Exception {
int task;
System.out.print ("Lists of Employees\n");
System.out.print ("What do you want to do?:\n");
System.out.print ("1 - Display list. \n2 - Insert New Name. \n3 - Delete an item. \n4 - Nothing." + "\n ");
task = Integer.parseInt (inp.readLine()); // I got a problem with this here. It's supposed to be a command that reads a char input. But I don't know how to do it too.
if (task==1) {
for(int k=0; k<5; k++)
System.out.println (employees[]);
}
}
}
I really can't seem to understand some sites on the internet that explains how to display string elements. Please, I really need help. @_@