java - bad operand type string for unary operator '+' -
i'm working on module class several student objects , have been experiencing following issue -
bad operand type string unary operator '+'
i appreciate assistance, code follows.
public class module { private string moduletitle; int percentagecoursework; int percentageexam; private student studentslist[] = new student[3]; public module (string moduletitle, int percentagecoursework, int percentageexam,string studentone, string studenttwo, string studentthree, string studentstitles[]) { this.moduletitle = moduletitle; this.percentagecoursework = percentagecoursework; this.percentageexam = percentageexam; this.studentslist[0].name = studentone; this.studentslist[1].name = studenttwo; this.studentslist[2].name = studentthree; } public void showdetails() { system.out.println("moduletitle : " + moduletitle + "\n percentagecoursework : " + percentagecoursework + "\n percentageexam : " + percentageexam + +studentslist[0].name+studentslist[1].name+studentslist[2].name); } }
"\n percentageexam : " + percentageexam + +studentslist[0].name+studentslist[1].name+studentslist[2].name); // ^ // ^ look! oh noes!
there +
in beginning of last line.
Comments
Post a Comment