what is the difference between if and switch statement job java interview

2,556 views · Published 29 November 2012 · 2:11 · Indexed 12 October 2026

Channel: Interview DOT · 2012 · Science & Technology

Watch on YouTube

Click here - https://www.youtube.com/channel/UCd0U_xlQxdZynq09knDszXA?sub_confirmation=1 to get notifications. You can submit your resume for right Job

http://www.interviewdot.com/upload-resume/uploadresume.htm
http://www.interviewdot.com http://www.interviewdot.com http://www.interviewdot.com

Welcome to www.InterviewDot.com
When does the compiler supply a default constructor for a class ? Java Interview Question and Answer :
When does the compiler supply a default constructor for a class ? 

The compiler provides a default constructor for a class if no other constructors are provided.

What is the difference between an if statement and a switch statement ?
The if statement is used to select among two alternatives. It uses a boolean expression to decide which alternative should be executed. 

If(condition){
}else {...}

The switch statement is used to select among multiple alternatives. It uses an int expression to determine which alternative should be executed.
switch(condition - int){
case 1 : ...... 
case 2:....
default :
}




You can submit your resume for right Job

http://www.interviewdot.com/upload-resume/uploadresume.htm
http://www.interviewdot.com http://www.interviewdot.com http://www.interviewdot.com

More from this channel