题目内容

You may have a return statement in a void method.

A. true
B. false

查看答案
更多问题

A _____ method does not return a value.

A. void
B. non-void

You must have a return statement in a non-void method.

A. false
B. true

A call for the method with a void return type is always a statement itself, but a call for the method with a non-void return type can be treated as either a statement or an expression.

A. false
B. true

Which of the following should be defined as a void method?

A. Write a method that returns a random integer from 1 to 100.
B. Write a method that converts an uppercase letter to lowercase.
C. Write a method that prints integers from 1 to 100.
D. Write a method that checks whether current second is an integer from 1 to 100.

答案查题题库