what is method
Anonymous #11313020
Level 1
how to draw flag
Under discussion
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
Abhishek TripathiExpert
31 July 2023, 14:14
Method is like a device or a thing that does something when it is called. In java a method looks like-
public static void thisIsAMethod()
{
//Doing something like addition or anything else
}
so this was a method it has any access modifier like public, private, default or protected in starting ( I have used public here ). After that a keyword (static or just nothing) and after it - A return type (like what will your method return integer String or any other data type) after this it has method name ( I have named it thisIsAMethod ) . After that inside curly braces it does something.
0