1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Writing a course class

Discussion in 'Java' started by cdominguez13, May 8, 2010.

  1. cdominguez13

    cdominguez13 New Member

    Joined:
    May 8, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello I am writing a course class:
    this is what I have so far

    HTML:
    public class Course
    {
     private String courseCode;
     private String courseName;
     private
     private int count
     
    I am stuck in the part that says private I am suppose to use the following and I dont know how to do it
    roster Student[] // Array of Students in the course
     
  2. satyedra pal

    satyedra pal New Member

    Joined:
    Mar 26, 2010
    Messages:
    93
    Likes Received:
    1
    Trophy Points:
    0
    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);
         }
      }
    }
     

Share This Page