خرید بک لینک

Vote count: 0

I've created a method in my controller(SMCController) of type Course[] to retu two courses. Every time I try to call this method in another class(view) it gives me a NullPointerExcep.

public Course[] setupAndGetCourses() {
    Module ctec3903 = new Module("CTEC3903", "Software Development Methods", 15, true);
    Module imat3451 = new Module("IMAT3451", "Computing Project", 30, true);
    Course compSci = new Course("Computer Science");
    compSci.addModule(ctec3903);
    compSci.addModule(imat3451);
    Course softEng = new Course("Software Engineering");
    softEng.addModule(ctec3903);
    softEng.addModule(imat3451);
    Course[] courses = new Course[2];
    courses[0] = compSci;
    courses[1] = softEng;
    retu courses;

}

What is the appropriate declaration/how would I pass this into my View?

Probably an easy fix but i'm new to java/FX/MVC

Thanks

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 29 فروردين 1395 ساعت: 8:53

صفحه بندی