Click here to Skip to main content
16,012,025 members
Home / Discussions / Java
   

Java

 
QuestionTelephone Interface Pin
muhammed_k13-Apr-12 22:22
muhammed_k13-Apr-12 22:22 
AnswerRe: Telephone Interface Pin
Richard MacCutchan13-Apr-12 22:25
mveRichard MacCutchan13-Apr-12 22:25 
GeneralRe: Telephone Interface Pin
muhammed_k14-Apr-12 0:56
muhammed_k14-Apr-12 0:56 
Questionhow to set the files become read only using java rmi Pin
dnafrinsi13-Apr-12 22:06
dnafrinsi13-Apr-12 22:06 
SuggestionRe: how to set the files become read only using java rmi Pin
Richard MacCutchan13-Apr-12 22:23
mveRichard MacCutchan13-Apr-12 22:23 
GeneralRe: how to set the files become read only using java rmi Pin
dnafrinsi17-Apr-12 2:16
dnafrinsi17-Apr-12 2:16 
GeneralRe: how to set the files become read only using java rmi Pin
Richard MacCutchan17-Apr-12 4:53
mveRichard MacCutchan17-Apr-12 4:53 
QuestionHow to Delete/remove index elements in 2D arrayList Pin
B.Bryce10-Apr-12 2:48
B.Bryce10-Apr-12 2:48 
I have this code below! I use this line
list.add(new Employee(1, "A","Delhi"));

to add elements. I want to remove the index element and I don´t know how to.
pleaese help me to solve this. Want an simple instrution to it, somewhink like list.remove( Emplyee(1, "A","Delph"))




import java.io.*;
import java.util.*;

class Employee{
public int id;
public String name;
public String address;
public static int count = 0; 
public Employee(){}
public Employee(int id, String name,String address) {
super();
this.id = id;
this.name = name;
this.address=address;
count++;
}
public int getId() {
return id;
}
public String getName() {
return name;
}
public String getAddress() {
return address;
}
}
public class DisplayArrayList {
 
public static void main(String[] args) throws Exception {
List<Employee> list = new ArrayList<Employee>();
list.add(new Employee(1, "A","Delhi"));
list.add(new Employee(2, "B","Mumbai"));
list.add(new Employee(3, "C","Chennai"));
list.add(new Employee(4, "D","Kolkata"));
 System.out.println(" ");
System.out.print("Enter Employee Id: ");
Scanner input=new Scanner(System.in);
int id = input.nextInt();
for (Employee s : list){
if(id == s.getId())
{
System.out.println("Name and Address of employee is: ");
System.out.print(s.getName()+" " +s.getAddress());

}
}
}
}

AnswerRe: How to Delete/remove index elements in 2D arrayList Pin
Richard MacCutchan10-Apr-12 5:38
mveRichard MacCutchan10-Apr-12 5:38 
GeneralRe: How to Delete/remove index elements in 2D arrayList Pin
B.Bryce10-Apr-12 7:11
B.Bryce10-Apr-12 7:11 
GeneralRe: How to Delete/remove index elements in 2D arrayList Pin
Richard MacCutchan10-Apr-12 8:27
mveRichard MacCutchan10-Apr-12 8:27 
GeneralRe: How to Delete/remove index elements in 2D arrayList Pin
TorstenH.10-Apr-12 19:20
TorstenH.10-Apr-12 19:20 
GeneralRe: How to Delete/remove index elements in 2D arrayList Pin
Nagy Vilmos11-Apr-12 2:07
professionalNagy Vilmos11-Apr-12 2:07 
GeneralRe: How to Delete/remove index elements in 2D arrayList Pin
TorstenH.11-Apr-12 3:54
TorstenH.11-Apr-12 3:54 
AnswerRe: How to Delete/remove index elements in 2D arrayList Pin
BobJanova11-Apr-12 1:09
BobJanova11-Apr-12 1:09 
AnswerRe: How to Delete/remove index elements in 2D arrayList Pin
Nagy Vilmos11-Apr-12 2:06
professionalNagy Vilmos11-Apr-12 2:06 
GeneralRe: How to Delete/remove index elements in 2D arrayList Pin
TorstenH.11-Apr-12 3:57
TorstenH.11-Apr-12 3:57 
GeneralRe: How to Delete/remove index elements in 2D arrayList Pin
Nagy Vilmos11-Apr-12 3:59
professionalNagy Vilmos11-Apr-12 3:59 
Questionjava SmS Application...... Pin
fahad479-Apr-12 19:59
fahad479-Apr-12 19:59 
AnswerRe: java SmS Application...... Pin
Anil Kumar 231-Jul-12 21:43
Anil Kumar 231-Jul-12 21:43 
QuestionSplitting one string Pin
Ejii8-Apr-12 21:27
Ejii8-Apr-12 21:27 
AnswerRe: Splitting one string Pin
Richard MacCutchan8-Apr-12 21:43
mveRichard MacCutchan8-Apr-12 21:43 
AnswerRe: Splitting one string Pin
Ejii8-Apr-12 22:27
Ejii8-Apr-12 22:27 
Questiononline shopping application in Java Pin
Member 87135148-Apr-12 20:30
Member 87135148-Apr-12 20:30 
AnswerRe: online shopping application in Java Pin
Richard MacCutchan8-Apr-12 21:41
mveRichard MacCutchan8-Apr-12 21:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.