Question: How many public methods (including constructors) does this class have? Refer to the following UML Class Diagram when answering this question. + weight ; float


How many public methods (including constructors) does this class have? Refer to the following UML Class Diagram when answering this question. + weight ; float + Pet(name : string, age ; int) + setName (name : String) : veld - setage (age : int) : void + scratch(itches : int + tostring() : String Vo Question 2 0/ 5 pts How many argumen Refer to the following UML Class Diagram when answering this question. + age : string + hasFleas : Books string + Pet(name : String, setName (name : String ) : void - setage(age : int) : void + scratch(itches : int, times : int) : + tostring() : String Question 3 5/5 pts The finally block of a try/catch structure block. s in the try True Question 4 5/5 pts A Queue is a First In First Out (FIFO) data structure. True Question 5 5/5 pts The finally block of a try/catch structure the try block. * False Question 6 5/5 pts A Java interface defines a set of methods that are required. . True False Question 7 0 / 5 pts A subclass that inherits instance variables from its super class cannot declare additional instance variables. False Question 8 0/ 5 pts An abstract method has a name, a return type, and code in its body, but has no parameters. . True Question 9 0/5 pts Evaluate the following code to determine what value will be at the bottom of the stack after the code completes. 4.push (25); 4-push (47):" push(5gjer>(): 75 Question 10 0/ 5 pts Evaluate the following code to determine the output. system. out. printl=(s.pop()); Question 11 0/ 5 pts Evaluate the following code to determine the output System. out. printle(q.remove() + q-remove()); Question 12 0/ 5 pts Evaluate the following code to determine what value will be at the back of the queue after the code completes. Question 13 0/ 5 pts Given the following partial code, fill in the blank to complete the code necessary to remove last node. (don't forget the semicolon) class Node public object data - full Node head - new Mode()1 // first Node head . next . next . next - new mode ( ) ; // fourth nod head next next.next - mull : Question 14 0/5 pts Given the following partial code, fill in the blank to complete the code necessary to insert node x after the third node. (don't forget the semicolon) lass Node public Mode next - mull head.next - new mede ): first mode ade x - new hodec): 79 36 toQuestion 14 0 / 5 pts Given the following partial code, fill in the blank to complete the code necessary to nsert node x after the third node. (don't forget the semicolon) class Node public object public Node next = null; Node hea head . next = new Node ( ); / / second Node head. next. next - new Node(); // third node Node x - new Node( ) ; / / node to insert head.next.next = x; Question 15 5 / 5 pts The benefit of data hiding is that we can make an object truly responsible for what it knows and what it does. True False Question 16 5/5 pts Which object oriented element is used to define "is a" relationships? Composition Encapsulation none of these Data Hiding Message Passing Polymorphism Inheritance Question 17 5 / 5 pts Which of the following iterative methods is equivalent to this recursive method? Int foo(int n) if (n e) { x to n ; return x; none of these int foo(int n) ( int x = 0; while (n >- 0) { * += n; return x; int foo(int n) { int x - n; while (n > e) { return x; Question 18 0 / 5 pts We can implement a getter method without a setter method, thus creating a read- only value. True False Question 19 0 / 5 pts During what activity do we directly analyze the language of the problem to identify objects, their attributes, and their behaviors? use case diagramming noun/verb analysis none of these problem description class outlining Question 20 5 / 5 pts A default constructor takes _ - argument(s). any number of
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
