1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
White raven [17]
3 years ago
15

Given public class Fishing { byte b1 = 4; int i1 = 123456; long L1 = (long) i1; //Line A short s2 = (short) i1; //Line B byte b2

= (byte) i1; //Line C int i2 = (int)123.456; //Line D byte b3 = b1 + 7; //Line E } Which lines WILL NOT compile? (Choose all that apply)
Computers and Technology
1 answer:
Aleksandr [31]3 years ago
5 0

Answer:

Line E.

Explanation:

The  given program is as follows:

public class Fishing {

   byte b1 = 4; int i1 = 123456; long L1 = (long) i1;   //Line A

   short s2 = (short) i1;     //Line B

   byte b2 = (byte) i1;     //Line C

   int i2 = (int)123.456;    //Line D

   byte b3 = b1 + 7;     //Line E

   }

In the above code Line E will not compile and give following compilation error:

error: incompatible types: possible lossy conversion from int to byte

This error is coming because in Java b1 + 7 will be interpreted as int variable expression. Therefore in order to make code of Line E work the expression should be type casted as byte.  

The correct code will be as follows:

public class Fishing {

   byte b1 = 4; int i1 = 123456; long L1 = (long) i1;   //Line A

   short s2 = (short) i1;     //Line B

   byte b2 = (byte) i1;     //Line C

   int i2 = (int)123.456;    //Line D

   byte b3 = (byte)(b1 + 7);     //Line E

   }

You might be interested in
Click cell i13 and calculate the agent commission using the base cost of the trip and a vlookup function that returns the commis
TiliK225 [7]
All you need to do is use excell.
5 0
3 years ago
THE DOMAIN IN AN EMAIL MESSAGE TELLS YOU THE
german
The domain in an email message tells you the type of service provider.

Hope this helped! :)
3 0
4 years ago
7
patriot [66]

Answer: i really don’t know

Explanation:

6 0
3 years ago
The residual volume can be measured directly with: Select an answer and submit. For keyboard navigation, use the up/down arrow k
TEA [102]

The residual volume can not be measured directly.

<h3>How is residual volume measured?</h3>

Residual volume is known to be measured by what we call a gas dilution test.

Note that this test often  measures how the concentration of the gases in the container changes.

<h3>What is residual volume?</h3>

This is known to be the Volume of air that is left over after a FORCED EXPIRATION. Note that it is one that cannot be measured by a spirometer.

Hence, The residual volume can not be measured directly.

Learn more about residual volume from

brainly.com/question/12897209

#SPJ1

6 0
2 years ago
Peter wants to query to determine the names of the students who scored more than 95 in the internal assessment test which functi
Mariulka [41]

the answer is floor

It's too short. Write at least 20 characters to explain it well.

8 0
4 years ago
Other questions:
  • Rob Janoff believes that technology should not be used too
    11·1 answer
  • Write an if-else statement with multiple branches. If givenYear is 2101 or greater, print "Distant future" (without quotes). Els
    9·1 answer
  • Write a program whose input is two integers and whose output is the two integers swapped. Ex: If the input is: 3 8 then the outp
    12·1 answer
  • Look at the graph. What is the meaning of the point shown with a star
    6·1 answer
  • Define Technology In Your Own Words.
    8·1 answer
  • In which type of modulation is a 1 distinguished from a 0 by shifting the direction in whichthe wave begins?
    14·1 answer
  • Open the site in your browser. (If any pop-up windows appear, think about what they indicate about the web site before you close
    12·1 answer
  • What happens when i expose a disk to magnetic fields?​
    5·1 answer
  • Give four example of computer virus​
    13·1 answer
  • A server malfunction has been resolved after replacing a failed hard drive. Enterprise services have been restored. What is the
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!