-2

I have a simple class

public class Address {
public String name;
public long mobile;
private String description;
private String address;
private boolean live;
}

and List addressList. I want to sort the AddressList object by name. Please help me out as i am new to java.

parul
  • 59
  • 1
  • 9

1 Answers1

0

AddressList object can be sorted on the basis of name property by using Comparator interface.

Please refer the link for more about Comparator

Praveen
  • 1,791
  • 3
  • 20
  • 33
Ashok Bala
  • 168
  • 1
  • 6
  • 23