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

public static char methodHeading(int n, double num) Based on the method heading

ID: 3639932 • Letter: P

Question

public static char methodHeading(int n, double num)

Based on the method heading in the accompanying figure, what is the return type of the value returned?


a static

b char

c int

d num



int larger(int x, int y)

Given the method heading in the accompanying figure, which of the following does NOT demonstrate method overloading?


a int larger(int x, int y, int z)

b int larger(char x)

c int max(int x, int y)

d double larger(double x, double y)


What is the default definition of the method toString?


a There is no default definition; you must define the method yourself.

b It creates a string that is the name of the object’s class, followed by the hash code of the object.

c It creates a string that is the name of the program.

d It creates a string that is the name of the package, followed by the name of the class, followed by the hash of the object.


Class members consist of all of the following EXCEPT ____.


a named constants

b variable declarations

c pre-defined methods

d methods

Explanation / Answer

please rate - thanks

public static char methodHeading(int n, double num)

Based on the method heading in the accompanying figure, what is the return type of the value returned?


a static

b char

c int

d num



int larger(int x, int y)

Given the method heading in the accompanying figure, which of the following does NOT demonstrate method overloading?


a int larger(int x, int y, int z)

b int larger(char x)

c int max(int x, int y) has a different method name

d double larger(double x, double y)


What is the default definition of the method toString?


a There is no default definition; you must define the method yourself.

b It creates a string that is the name of the object’s class, followed by the hash code of the object.

c It creates a string that is the name of the program.

d It creates a string that is the name of the package, followed by the name of the class, followed by the hash of the object.


Class members consist of all of the following EXCEPT ____.


a named constants

b variable declarations

c pre-defined methods

d methods