Cloekt Cloek ( int, int, int) etTire(int, int, intjt void getHour printTime voia
ID: 3726605 • Letter: C
Question
Cloekt Cloek ( int, int, int) etTire(int, int, intjt void getHour printTime voia int int teqran le (Clock)boolean 46. According to the UML class diagram above, which of the following is a. ClockO _ data member c. min d. Clock b. According to the UML class diagram above, which method is pablic and doesn't return anything? a getCopyO b. setTime(int, int, int) which ofthe following would be a default constructor ior he ein. Click does is te ips bro a. public ClockOf setTime(0, 0,0;:) b. public Clock(0, 0, 0) ( setTimeO: ) c. public Clock(0)setTime(0) d. private Clock(10)f setTime0: ) Constructors have the same name as the a. member methods b. data members 47. c. equals(Clock) d. incrementFloursO 48, 49. c. class d. package 50. Which of the following is used to allocate memory for the instance variables of an obiject of a class? the operator new the operator + c a- b· the reserved word public the reserved word static d.Explanation / Answer
Answer:
46. Option c (min)
In class diagram, the class has three parts i) class name ii) attributes (data members) iii) operations (member functions)
The second part has attributes or members of the class. So, 'min' is one of the data members of the class Clock.
47. Option b (setTime(int,int,int))
Any method which doesn't return anything is 'void' type.
In the given options, setTime(int,int,int):void means setTime(int,int,int) returns nothing.
48. option a (public Clock() { setTime(0,0,0);}
49. Option c (class)
Constructors have same name as the class
50. Option c (the operator new)
new operator is used to allocate the memory for instance variables of objects of a class.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.