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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!