Today we were taught about Functions in Java.Actually i should say Methods in java.A method is a set of code which is referred to by name and can be called (invoked) at any point in a program simply by utilizing the method's name. Think of a method as a subprogram that acts on data and often returns a value. Each method has its own name. When that name is encountered in a program, the execution of the program branches to the body of that method. When the method is finished, execution returns to the area of the program code from which it was called, and the program continues on to the next line of code.
Basically there are two types of Methods:
Buit-in Methods
User Defined Methods
Built in methods are such Math functions,string functions etc.
whereas
User Defined Methods are defined by the User itself .User Defined Functions Can of three types:
Without Any Arguement and Without returning a Value.
With Arguement and Without returning a Value.
With Arguement and With returning a Value.
0 comments:
Post a Comment