






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Please PRINT your name: Last Name:__________________ First Name:__________________
Circle T for True or F for False, for each of the following questions. T F (1) A string is a sequence of characters. String is one primitive data type in Java language. T F (2) There are times when it is appropriate to return data from a method of a type that is inconsistent with the return type specified in the method header. T F (3) Java supports multiple inheritance. T F (4) If a class implements an interface, it cannot extend another class. T F (5) In a linked implementation of a stack, a pushed element should be added to the end of the list. T F (6) Every line in a catch block is guaranteed to be executed in all situations.
(5 Bonus Points!!!) Suppose that the integer array firstArray has been declared and initialized as follows: int[] firstArray = {10, 20, 30, 40, 50} Given this array, what is the result of calling the method mystery(firstArray); if mystery is defined as: public static void mystery(int[] array) { int tmp = array[array.length-1]; for (int i=1; i < array.length; i++) array[i] = array[i-1]; array[0] = tmp; } Work through the method carefully and indicate your answer by filling in the boxes below to show the final contents of firstArray :