Question: 17) new Num is a string object that holds an int value. Which expression below returns the double value? a) Double.parseDouble): b) new Num.double): c)
17) new Num is a string object that holds an int value. Which expression below returns the double value? a) Double.parseDouble): b) new Num.double): c) new Num.parseDouble(): d) Double.new Num(); e) There is no way to return the value as a double. is the automatic conversion between a primitive value and a corresponding wrapper 18) object. al Generating b) Aliasing c) Number formatting d) Static invocation e) Autoboxing 19) Suppose we have a string object referenced by a variable called listing. Suppose we want a new String object that consists of the first 5 characters in listing. Which of the following lines of code will achieve this? a) b) c) d) e) String prefix = listing.front(s); String prefix listing.front(6); String prefix listing.substring(1,5); String prefix = listing.substring(0,5). String prefix listing.firstChars(5); 20) Suppose that we have a string object referenced by a variable called city that contains the characters "new york". Which of the following will change city to capital letters. a) city.convertCase(); b) city.toUpperCase(); c) city.changeCasel); d) city.concat(); e) none of the above. 21) Suppose we want to condition an if statement on whether two String objects, referenced by stringOne and stringTwo, have the same contents. Which of the following is the correct way to achieve this? a) if(stringOne == stringTwo) b) if(stringOne.compare To(stringTwo)) c) if(stringOne.equals(stringTwo)) d) if(stringOne != stringTwo) e) if(stringOne === stringTwo)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
