+ 1
Hello! Can someone tell me why you put public,void,static at the same time and bot oly one? Thank you
4 Antworten
+ 2
You don't have to put all of them together. They have different uses. public declares the method as public, so it can be accessed in whatever scope the object is declared in. void means there's isn't a return. static means that member/method is shared throughout all instances of the class.
EDIT: Oops, I didn't realize this was for Java, I thought it was for C++. I'd imagine it still applies.
+ 2
Ben Allen (Njinx) you are right, it still applies. They have same meaning in java and c++ both.
0
tank you too much!