Java - Interview Questions and Answers for 'Switch' | Search Java Interview Question - javasearch.buggybread.com
Javasearch.buggybread.com
Share

Search Java Interview Questions


 2137 questions in repository.
 There are more than 200 unanswered questions.
Click here and help us by providing the answer.
Label / Company      Label / Company / Text

   



Interview Questions and Answers for 'Switch' - 3 question(s) found - Order By Newest

 Q1. What data type Variable can be used in a switch statement ?Core Java
Admin
info@buggybread.com
Ans. Variables used in a switch statement can only be a byte, short, int, or char ( and String with Java 7 and above )

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   switch   variable   data type      basic        rare


Related Questions

  Which of the following was not introduced with Java 5 ?
  Strings in switch were introduced in Which Java version ?
 Difference between if and switch ? Can we replace all switch statements with if statements ?


 Q2. Strings in switch were introduced in Which Java version ?

a. Java 5
b. Java 6
c. Java 7
d. Java
Core Java
Anonymous
Ans. Java 6

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     java   switch   string in switch


Related Questions

  What data type Variable can be used in a switch statement ?
  Which of the following was not introduced with Java 5 ?
 Difference between if and switch ? Can we replace all switch statements with if statements ?


 Q3. Difference between if and switch ? Can we replace all switch statements with if statements ?Core Java2017-07-24 13:10:25

Ans. if statement is used to do 2 direction branching whereas switch is used to do multi direction branching in Java.

Yes we can replace all switch statements with nested if statements.

 Help us improve. Please let us know the company, where you were asked this question :   

   Like      Discuss      Correct / Improve     switch  if vs switch


Related Questions

  What data type Variable can be used in a switch statement ?
  Which of the following was not introduced with Java 5 ?
  Strings in switch were introduced in Which Java version ?




Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner



comments powered by Disqus
 

Help us and Others Improve. Please let us know the questions asked in any of your previous interview.

Any input from you will be highly appreciated and It will unlock the application for 10 more requests.

Company Name:
Questions Asked:
         

X Close this

X Close this

Help Us Improve.
Please share your
interview experience.

Company Name:   


Questions Asked: