Multiple Choice Question

Quiz Guidelines

 

QID: 
463
Question: 

What can be the return type of method get Switch so that this program compiles and runs without any problems?

public class TestClass{
   public static XXX getSwitch(int x){
      return x - 20/x + x*x;
   }
   public static void main(String args[]){
       switch( getSwitch(10) ){
          case 1 :
          case 2 :
          case 3 :
          default : break;
       }
   }
}

Select 1 option

A. int 
B. float
C. long
D. double
E. char
F. byte
G. short

Q&A Set: