Document Details

PunctualWisdom8460

Uploaded by PunctualWisdom8460

Algonquin College

Tags

programming questions java programming computer science exam review

Summary

This document contains a set of programming questions, potentially from a past exam review. It covers various concepts, including Java programming, OOP, and arrays, among others. The questions are designed for self-assessment and review.

Full Transcript

### **Question 1** - - ### **Question 2** **Statement**: \_\_\_\_ errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error. - - - - - - ### **Question 3** **Statement**: The \"building blocks\" that Java programmers u...

### **Question 1** - - ### **Question 2** **Statement**: \_\_\_\_ errors are relatively easy to locate and correct because the compiler or interpreter you use highlights every error. - - - - - - ### **Question 3** **Statement**: The \"building blocks\" that Java programmers use to write computer programs are called \_\_\_\_\_\_\_. - - - - - - ### **Question 4** **Statement**: In Java, objects within the same class share common \_\_\_\_\_\_\_. - - - - - ### **Question 5** **Statement**: The access specifier in the declaration of instance variables should be \_\_\_. - - - - - ### **Question 6** **Statement**: What is the diagram type we are learning to use in UMLet? - - - - - - ### **Question 7** **Statement**: A method\'s name and a list of parameter types together are its \_\_\_\_. - - - - - - ### **Question 8** **Statement**: Which statement is true? - - - - - - ### **Question 9** **Statement**: A short-circuit evaluation is where each part of an expression is evaluated only as far as necessary to determine whether the entire expression is true or false. - - - ### **Question 10** **Statement**: What kind of operator is the \ Add to Index\ **Explanation**: **Team \> Add to Index** stages the files, which allows them to be tracked by Git for version control. After this, you can commit the changes to your Git repository.\ **Incorrect Answers**: - - - ### **Question 17** **Statement**: Many newer programming languages, such as Java, use the square bracket notation for arrays. - - - ### **Question 18 (1 point)** **Statement**: Consider the following line of code: Which one of the following options is a valid line of code for displaying the twenty-eighth element of somearray? **Options**: - - - - **Correct Answer**: D. System.out.println(somearray\[27\]); - ### **Question 19 (1 point)** **Statement**: When memory mapping a variable of primitive type, we place \_\_\_\_\_ into the box representing the variable. **Options**: - - - - **Correct Answer**: C. the literal value - ### **Question 20 (1 point)** **Statement**: When you search through a list from one end to the other, you are performing a \_\_\_\_. **Options**: - - - - **Correct Answer**: A. linear search - ### **Question 21 (1 point)** **Statement**: When an array myArray is only partially filled, how can the programmer keep track of the current number of elements? **Options**: - - - - **Correct Answer**: B. maintain a companion variable that stores the current number of elements - ### **Question 22 (1 point)** **Statement**: Given this code, what would a memory map look like? **Options**: - - - **Correct Answer**: A. I would write variable sheeps, and draw an adjacent box with null in it. - ### **Question 23 (1 point)** **Statement**: In implementation hiding, the calling method needs to understand only the interface to the method that is called and it need not know how the method works internally. **Options**: - - **Correct Answer**: A. True - ### **Question 24 (1 point)** **Statement**: Which class category has static methods and constants, but no objects? **Options**: - - - - **Correct Answer**: C. Utility class - ### **Question 25 (1 point)** **Statement**: Why should we avoid using static for everything? **Options**: - - - **Correct Answer**: A. We will only have one copy of the fields in memory, making it impossible to have objects with separate field values. -

Use Quizgecko on...
Browser
Browser