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
What is the function of cpu while processing data?​
attashe74 [19]

Answer:

"Store date, intermediate results, and instructions (program."

Explanation:

"CPU is considered as the brain of the computer. CPU performs all types of data processing operations. It stores data, intermediate results, and instructions (program). It controls the operation of all parts of the computer."

3 0
2 years ago
Read 2 more answers
Which option in a Task element within Outlook indicates that the task is scheduled and will be completed on a later date?
dalvyx [7]

Answer:

in progress

Explanation:

it is being answered by the person

3 0
3 years ago
There is an increasing need for private security personnel because of declining resources for many government agencies and a sho
aivan3 [116]
<span>True
</span><span>There is an increasing need for private security personnel because of declining resources for many government agencies and a shortage of police officers in many communities due to lack of funding.

</span>
8 0
3 years ago
45 POINTS!!!!!!!!!!!PLZ HELP ME!!!!!!!!!!Select the correct answer. Which statement describes a characteristic of dynamic websit
Gemiola [76]

Answer:

D

Explanation:

Because anyone can update dynamic websites at any time, these are more functional and flexible. Therefore, content on dynamic websites keeps changing. Diverse content encourages users to return to these websites. The disadvantages of dynamic websites are that they are more expensive and take longer to develop than static websites. Hosting dynamic websites also costs more.

6 0
3 years ago
Read 2 more answers
When it comes to wireless channels, which channels never overlap?
krok68 [10]

Answer:

In the 2.4 GHz band, 1, 6, and 11 are the only non-overlapping channels. Explanation:

Selecting one or more of these channels is an important part of setting up your network correctly.

6 0
2 years ago
Other questions:
  • What's the code?
    6·1 answer
  • The groups_per_user function receives a dictionary, which contains group names with the list of users. Users can belong to multi
    11·1 answer
  • Your assignment is to write an assembly language program which read a string and print it in uppercase. This program asks the us
    15·1 answer
  • Harry wants to change the background of all of his presentation slides. Which slide will enable him to make this change to all t
    14·1 answer
  • When network cards are communicating, bits can occasionally be corrupted in transmission?
    5·1 answer
  • Using Python I need to Prompt the user to enter in a numerical score for a Math Class. The numerical score should be between 0 a
    7·1 answer
  • Edhesive in JAVA Write a method that takes a String parameter. If the String has a double letter (i.e. contains the same letter
    13·1 answer
  • Explica el empleo de cuentas y contraseñas en archivos
    6·1 answer
  • An additional factor in how an element is rendered is that properties are passed from a parent element to its children in a proc
    15·1 answer
  • Please solve this in JAVA<br><br> Please see the attachment
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!