Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

QUESTION 1 Which is true of the following method? Does not compile Returns the s

ID: 3873659 • Letter: Q

Question

QUESTION 1

Which is true of the following method?

Does not compile

Returns the same value as

return ((a && b) || (!a && !b));

Compiles but causes an error at runtime

Returns the same as

return a && b;

1 points   

QUESTION 2

All methods have a parameter list delimited by open and close parenthesis

True

False

1 points   

QUESTION 3

What is printed?

1 points   

QUESTION 4

Which of the following passes the parameter i by reference?

public static void aMeth(int &i)

public static void aMeth(int *i)

public static void aMeth(ref int i)

Passing a parameter by reference can't be done

1 points   

QUESTION 5

What is the most significant difference between the following snippets?

and

The second for loop will not compile

There is no significant difference

The scope of i

The second for is an infinite loop

1 points   

QUESTION 6

Multiple answer:

Which of the following have the same signature as

public static void aMeth(int i, double d)

public static void aMeth(double d, int i)

public static void aMeth(double i, int d)

public static void aMeth(int d, double i)

public static void aMeth(int i, String d)

public static void aMeth(int i, int d)

1 points   

QUESTION 7

A method has a header followed by a body delimited by curly braces

True

False

1 points   

QUESTION 8

A method is a "grouping" mechanism that lets us give a name to a collection of statements and not worry about their details

True

False

1 points   

QUESTION 9

Which is true of the following method?

The method does not compile

The method compiles but gives an error at runtime

The method returns i's value

The method prints i's value

1 points   

QUESTION 10

Fill in the blanks

The ________ parameter in the method header is a placeholder for the __________ parameter value

actual/formal

formal/actual

header/calculated

type/used

1 points   

QUESTION 11

What is true of the following method?

The method will compile, but will not run

The method returns 0

The method will not compile

The method is the same as

public static void aMeth() {}

1 points   

QUESTION 12

The naming convention specifies that method names

must start with an upper case letter

final methods must have names in all upper case

may start with either a lower or upper case letter

must start with a lower case letter

Does not compile

Returns the same value as

return ((a && b) || (!a && !b));

Compiles but causes an error at runtime

Returns the same as

return a && b;

Explanation / Answer

Question 1

Answer:

Returns the same value as

return ((a && b) || (!a && !b));

Question 2

Answer:

True

Question 3

Answer:

676

Question 4

Answer:

Passing a parameter by reference can't be done

Question 5

Answer:

The scope of  i

Question 6

Answer:

public static void aMeth(int d, double i)

public static void aMeth(int i, int d)

Question 7

Answer:

True

Question 8

Answer:

True

Question 9

Answer:

The method does not compile

Question 10

Answer:

formal/actual

Question 11

Answer:

The method is the same as

public static void aMeth() {}

Question 12

Answer:

may start with either a lower or upper case letter

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote