This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The commented-out line is calling a method named TotClassFee() that doesn't exist. You mean to print the variable TotClassFee, I imagine (no parentheses).
But you surely don't want the getTotClassFee() method to print anything at all, right? That's the main program's job. It needs to capture the value returned from calling that function into a variable of its own, and then print that variable. Make sense?
As everyone has pointed out, the computer will only do what you tell it to do. So you need to have a System.out.println() call in order to print something out. As Ernest says, this line probably belongs in your main() method, not in the getTotClassFee() method.
Monic, there are some problems with the logic of your program, and you will have to sort them out before it will do what you want.
The program code you have shown us reads the number of credit hours from the user, BUT it doesn't pass that information to the myStudentBill object, so the object won't be updated, and even when you do work out how to print out the fees value, it won't be correct.
Also, once you update the credit hours in the object, how will the TotClassFee field get updated? The class has two methods to do this (StudentBill() and ClassFee() - you don't need both of these) but they will only execute if instructed to do so. A good way to do this would be to give the class a setCreditHours() method, which would: