You may use the array of the the record of the studentcourse and also by implementing list you can do within better format,
Code are following:
Code:
import java.util.Arrays;
import java.util.List;
public class course 
{
    
public static void main(String[] arg) 
  {
    String[] coursename = {"B.tech", "MBA", "MCA"};
    List<String> courseList = Arrays.asList(coursename);
    for(String courses : courseList) 
    {
            System.out.println(students);
     }
  }
}