Question
5. Given the variable declarations below: byte myByte; int myInt; long myLong; char myChar; float myFloat; double myDouble; Which one of the following assignments would
5. Given the variable declarations below:
byte myByte; int myInt; long myLong; char myChar; float myFloat; double myDouble;
Which one of the following assignments would need an explicit cast (choose all that appy)? a) myInt = myByte; b) myInt = myLong; c) myByte = 3; d) myInt = myChar; e) myFloat = myDouble;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
3. If s1 is declared as: String s1 = "phenobarbital"; What will be the value of s2 after the following line of code executes?
String s2 = s1.substring( 3, 5 );
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
4. Which method below can change a String object, s ?
a. equals( s )
b. substring( s )
c. concat( s )
d. toUpperCase( s )
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started