Computer Science, asked by rks9918431143, 8 months ago

what are the methods?

what do they represent in Java

Answers

Answered by sejalkdiwan
3

Answer:

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 may, or may not, return a value. Each method has its own name.

The keyword this in Java is a special keyword that represents the object you are currently executing within. The keyword may be invoked from within a constructor or method, and is simply prepended to the variable in question using the period (.) operator. An example can be seen in the code below.

Answered by hayarunnisamuhammedp
5

A method in Java is a set of instructions that can be called for execution using the method name. A Java method can take in data or parameters and return a value - both parameters and return values are optional. Methods can be public, private or protected.

HOPE THIS HELPS YOU BETTER

PLZ MARK ME AS BRAINLIEST

Similar questions