Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Java (http://www.go4expert.com/forums/java/)
-   -   Writing a course class (http://www.go4expert.com/forums/writing-course-class-t22037/)

cdominguez13 8May2010 07:59

Writing a course class
 
Hello I am writing a course class:
this is what I have so far

HTML Code:

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

satyedra pal 12May2010 11:31

Re: Writing a course class
 
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);
    }
  }
}



All times are GMT +5.5. The time now is 16:30.