Question
Result 1941
(a) Differentiate between if else if and switch-case statements (b) Give the output of the following code: String P = "20", Q ="19"; int a = Integer.parseInt(P); int b = Integer.valueOf(Q); System.out.println(a+""+b); (c) What are the various types of errors in Java? (d) State the data type and value of res after the following is executed: char ch = '9'; res= Character.isDigit(ch); (e) What is the difference between the linear search and the binary search technique?
Answer (a) if else if switch-case if else if can test for any Boolean expression like less than, greater than, equal to, not equal to, etc. switch-case can only test if the expression is equal to any of its case constants. if else if can use different expressi...
View Details
/question/8154