Question: Java Question Please highlight the 1 correct option from 4 given at bottom Which code snippets are valid return statements for method1() and method2()? public

Java Question

Please highlight the 1 correct option from 4 given at bottom

Which code snippets are valid return statements for method1() and method2()?

public void method1(){

// CODE SNIPPET 1

}

public Float method2(){

// CODE SNIPPET 2

}

  • return null; for CODE SNIPPET 1 and return 12.3; for CODE SNIPPET 2

  • return; for CODE SNIPPET 1 and return null; for CODE SNIPPET 2

  • return null; for both CODE SNIPPET 1 and CODE SNIPPET 2

  • return; for CODE SNIPPET 1 and return 12.3; for CODE SNIPPET 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!