javascript
Brief description  about Online courses   join in Online courses
View SANJAY  Bhoite 's Profile

compilation error - missing return statement

I have written following code which is giving me compilation error as " Missing return statement" , what could be the reason?

class SchoolStd {

int TotalDiv = 1;
int TotalStudents=0;

void CountDiv (int Value) {
TotalDiv= Value;
}

void CountStudent (int Value) {
TotalStudents= Value;
}


void FirstStdPrintState ( ) {
System.out.println (" Total No of Divisions for First standard" TotalDiv );
System.out.println ("Total no of students" TotalStudents );
}


Void SecondStdPrintState () {
System.out.println (" Total No of Divisions for First standard" TotalDiv );
System.out.println ("Total no of students" TotalStudents);
}
}
Asked by SANJAY Bhoite | May 8, 2014 |  Reply now
Replies (1)
View Java Teacher 's Profile
Here you don't have main function. So how can it be execute?

Make a class in which declare the main method and call the above mentioned method.
May 11, 2014