ArrayList<MArry> databas = new ArrayList<MArry>();
        //Add data into the databas
        databas.add(new MArry("Timothy", "SS1"));
        databas.add(new MArry("Olayemi", "SS2"));
        System.out.println("Student\tClass\n");

        for (MArry myarry: databas) {
            System.out.printf("%s \n", myarry);
        }

  /*Please I need someone to check this out.
  Each time I run the code the output I'm getting is the memory address of the ArrayList */

Sounds like you had failed to provide a meaningful toString() method for the MArry class, so it's just inheriting the default toString() from Object, which just returns the object's hash, which is typically it's memory address.
Overide public String toString() in your MArry class to return a String that represents the contents of that class.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.