What is the method to declare hello() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the method to declare hello()

give me the answer

19th Aug 2018, 8:24 AM
Patiam WizKhalifanne
Patiam WizKhalifanne - avatar
2 Answers
+ 2
depends on what you want, does the method return something or is it void? syntax for a method accessSpecifier returnType methodName(parameter list) example public void hello() static is an optional modifier that makes the method part of the class instead of just the objects
19th Aug 2018, 10:04 AM
Robert Atkins
Robert Atkins - avatar
0
static void hello(){}
19th Aug 2018, 8:57 AM
michal