Question
Question 33 (0.75 points) After the following code is run, which array element contains the letter Q ? String [ ] names = new String
Question 33 (0.75 points)
After the following code is run, which array element contains the letter "Q" ?
String [ ] names = new String [10]; names[5] = "Q";
Question 33 options:
| the 4th element |
| the 5th element |
| the 6th element |
| the 7th element |
Question 34 (0.75 points)
Any for loop can be re-written as
Question 34 options:
| an arithmetic operation |
| a while loop |
| an if-statement |
| a for-each loop |
Question 35 (0.75 points)
Which of the following gives you the size of an array named 'numbers'?
Question 35 options:
| numbers.size() |
| numbers.length |
| numbers.size |
| numbers.length() |
Question 36 (0.75 points)
Accessing indices outside the bounds of an array will lead to
Question 36 options:
| a runtime error: ArrayIndexOutOfBoundsException |
| a compile error |
| no error, but corrupt data |
| additional memory will be added to the array, making the new indices valid |
Question 37 (1.5 points)
Match the situation with the best choice of loop:
Question 37 options:
|
|
Question 38 (0.75 points)
Match each term with a definition.
Question 38 options:
|
|
Question 39 (0.74 points)
Write the signature of the main method that is the starting point for a Java program (starting with "public"). Answer is case-sensitive since Java is case-sensitive.
Question 39 options:
Question 40 (Mandatory) (0.01 points)
The following resources are allowed during the exam:
- Your textbook
- Your notes (electronic or hardcopy)
- BlueJ
- All materials on our course web site, including all your past work & exams (anything you can access on the course web site)
- Any of the web sites linked to in the Java Resources box on our course home page.
- Any other web sites you have been using as a Java or programming reference during this course.
Type your name in the box to attest that you have not used any other resources, and you have not performed any internet searches during this exam.
Question 40 options:
Previous PageNext Page
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started