MCQ
Single Best Answer
Easy
QYou are to complete the code needed to create a method within a class. Your method will NOT return information. Which will best complete this statement?
public __________ myMethodName
ID: #9376
Module 13: Classes
176 views
Question Info
#9376Q ID
EasyDifficulty
Module 13: ClassesTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
Justification:
- The void keyword is used before a method name to indicate that the given method does not return a value.
- The null keyword is not used for specifying whether a method returns a value or not.
- Placing the “str” keyword before the method name implies that it will be returning a value of type string.
- Return is not a valid keyword to be used before a method.
Related Lesson: Create a Base Class
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic