+ 1
encapsulation
How to i code a method from UML that take three parameters Example +setTime(int Hours, int minutes, int seconds) : void Please help
3 Respostas
+ 1
I believe that is
public void setTime(int hours, int minutes, int seconds) { /*code*/ }
the first symbol is the access modifier (I think + is public) and the return type is at the end. The actual code is up to you of course
+ 1
well the method says setTime so it needs to set the time somehow, set a class variable or something the implementation is up to you. The UML gives you how the method should behave at the top level, i.e. what should it return (in this case nothing) and its visibility to other classes
0
I am till not clear