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]
2 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]2 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 job does a front-end developer perform?
alina1380 [7]

Answer:

They manage making websit/es beautiful. Basically how brainly is setup? The layout is nice? Front end developers are responsible for why webpages look pretty or nicely done. <em>fun fact, my dream job is a front end developer!</em>

5 0
2 years ago
Which utility would you use to test communication on your own computer using your ip address as a parameter?
olganol [36]
Ping and traceroute locally and on a remote server. Locally it will tell if you local setup is correct and to test your network communication it needs to travel over a network.
5 0
3 years ago
On Windows computers, applications from Microsoft will not look and act the same as windows and menus from the operating system.
Andrej [43]

True.

Windows is an operating system built by Microsoft. Chrome and Android are operating systems built by Google. MacOS (Macbook pro etc) and iOS (iPhone, iPad, Apple Watch etc) are operating systems built by Apple.

Engineers build applications or apps for all of the above operating systems (OS). For example, Microsoft Word menus will look slightly different on Windows vs on a Mac. The underlying functionality maybe the same but the way it looks may have subtle differences.

Think of the OS as the foundation of a building. Once you have the foundation, you can build a house, a skyscraper, an office building etc depending on what you want to build.

6 0
2 years ago
Read 2 more answers
ANSWER QUICKLIY
lidiya [134]

Answer:

Explanation:

Allow you to view the document in different ways. Sorry if I am wrong. I am dumb

God bless, stay safe, and good luck! :)

4 0
2 years ago
Read 2 more answers
(Game Design) Creating and manipulating data structures is one of the primary functions of a development environment.
Galina-37 [17]

true i believe im not for sure

7 0
3 years ago
Read 2 more answers
Other questions:
  • How to write a program converting RGB to CMYK in python
    6·1 answer
  • To copy noncontiguous slides, open Slide Sorter view, click the first slide thumbnail, press and hold ____, click each additiona
    15·1 answer
  • Select the correct answer. What has enabled engineers to design slim and sleek television sets? A. using Nipkow disks B. increas
    7·1 answer
  • Meaning of page break​
    8·1 answer
  • Identifies the row and column that forms the cell
    11·1 answer
  • It is an array containing information such as headers, paths and script locations wherein it is created by the web server itself
    8·1 answer
  • Study the sentences below. A.Changing the properties of characters in a sentence or paragraph in a Word document helps increase
    5·2 answers
  • Write a function called has_duplicates that takes a string parameter and returns True if the string has any repeated characters.
    7·1 answer
  • User Interface Design ensures that the interface has elements that are easy to ________________. (Choose all that apply)
    10·2 answers
  • What are the words that make up a high-level programming language called?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!