title: Sort list of integers and strings Java
body: <p>i have to sort 3 objects that contains two integers and 1 string, my question is since I'm new to java, how can i call the object into the method, this is my code so far: So what I'm trying to do is to sort all 3 objects in increasing order, by age, name, general grade, how can i call all of them so i can sort ?, or if I'm doing it wrong, what the alternative? i need to use List and the 3 objects thank you in advance.</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.Collections;
  import java.util.List;
  
  public class Student {
  
      int age;
      int generalGrade;
      String firstName;
      String lastName;
  
      public Student(int age, String firstName, String lastName, int generalGrade) {
          this.age = age;
          this.generalGrade = generalGrade;
          this.firstName = firstName;
          this.lastName = lastName;
      }
  
      public static void main (String[] args) {
  
          Student myStudent = new Student(19, "A", "X", 100);
          Student myStudent1 = new Student(20, "B", "P", 98);
          Student myStudent2 = new Student(19, "C", "N", 70);
  
          Age(myStudent);
  
  
      }
  
      public void Age(int[] age) {
  
          List studentAge = new ArrayList(Arrays.asList(age));
          System.out.println("List values before sort " + studentAge);
          Collections.sort(studentAge);
          System.out.println("List value after sort: " + studentAge);
      }}   
  </code></pre>