+ 2
In declaring your own method in java can you add ' public' in the declaration
5 ответов
+ 8
Yes, you can add public in the declaration like:
public returnType myMethod() {
return value;
}
+ 3
yes you can. depending on how nd were u want you method to b accessible from.
+ 2
Yes the "public" modifier states that the method can be called from outside the class as opposed to private which prevents a function being called from outside the class.
+ 1
yes...the 'public' keyword is used to make that method accessible to to all other java classes in your project
+ 1
yes public can be added
public void myMethod(){
--- - - - -
statements
}