CodeHS Java Methods Checks

Ace your homework & exams now with Quizwiz!

What is a Javadoc? The reference guide to Java that is in the back of a textbook. A program that cures the bugs in your Java program. Data that gets passed into a method A comment that clearly states the functionality and usage of a class or method.

A comment that clearly states the functionality and usage of a class or method.

Why do we use methods in Java programming? Break down our program into smaller parts Avoid repeating code Make our program more readable All of the above

All of the above

Does the following code snippet have a run time error, compile time error, both, or neither? int x = 3 int y = 4; int sum = x + y; Run time error Compile time error Both Neither

Compile time error

Question: 2 Which exception will be thrown as a result of running this code snippet? String hello = "hello"; char last = hello.charAt(10); IndexOutOfBoundsException ArithmeticException IllegalArgumentException None

IndexOutOfBoundsException

What are parameters? The value that a method returns. The values that a method prints to the screen. The formal names given to the data that gets passed into a method. The type that is given to a variable.

The formal names given to the data that gets passed into a method.

What is a return value? The value that a method prints to the screen. The value that is inputted to a method. The value that a user inputs to a program. The value that a method outputs.

The value that a method outputs.

What will this method call output? public boolean someMethod(int number) { if(number % 2 == 0) { return true; } else { return false; } } someMethod(9990) false 0 "true" true

true


Related study sets

NC Certification Exam - Life and Health - Missed questions

View Set

Jdiontest6, jdiontest5, jdiontest4, Jdiontest3, Jdiontest2, Jdiontest1

View Set

Anatomy & Physiology - CH 19 Blood Vessels And Circulation

View Set

ATI Nutrition Part 3: Food Safety, Cultural Ethnic and Religious Influences, and Nutrition Across the Lifespan

View Set

Sistemas informativas de gestion

View Set

Ch. 7 Exam Questions (Life) - Group Life Insurance

View Set

BCHM 3984 Module 5 Practice Questions

View Set