Solved

What Is Incorrect in the Following Code Snippet

Question 80

Multiple Choice

What is incorrect in the following code snippet?
Public static void displayBox(String str)
{
System.out.println("--------") ;
System.out.println(str) ;
System.out.println("--------") ;
}
Public static void main(String[] args)
{
System.out.println(displayBox("Hello World") ) ;
}


A) displayBox is called with incorrect arguments.
B) displayBox should be called in an assignment statement.
C) The return value from displayBox is never used.
D) displayBox does not return a value; therefore, it cannot be used with System.out.println

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents