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
Write out a shorthand version of the border property which will apply border that is 5 px wide, colored in lightgreen, and solid
Sever21 [200]

Answer:

border: 5px solid lightgreen;

Explanation:

The shorthand version of the border property in CSS goes as follows:

 border: <line-width> <line-style> <color>;

With <line-width> represents the thicknes of the border line (expressed in keyword values or lenght values), <line-style> represents the style of the border, and <color> represents the color of the border (in color names or values).

6 0
3 years ago
Identify the sampling technique used:A lobbyist for a major airspace firm assigns a number to each legislator and then uses a co
trapecia [35]

Answer:

Random Sampling

Explanation:

Random Sampling technique is being used in the given scenario.

3 0
3 years ago
Select the correct answer.
Bess [88]

Answer:

equals operator...............

6 0
3 years ago
Write the definition of a function typing_speed, that receives two parameters. The first is the number of words that a person ha
Lera25 [3.4K]

Answer:

The definition of function is as follows:

def typing_speed(number_of_words,Time_Interval):

number_of_words>=0  

Time_Interval>0

speed=float(60*number_of_words/Time_Interval)

return speed

Explanation:

Above function is defined step-by-step as follows:

        def typing_speed(number_of_words,Time_Interval):

  • A function named typing speed has two arguments, num_of_words and Time_Interval.

                             number_of_words>=0  

                             Time_Interval>0

  • The variable number_of_words is the number of words entered that a person enters, they must be greater than or equal to 0. Where as Time_Interval is the variable for counting the time span in seconds, it must be greater than 0.

                    speed=float(60*number_of_words/Time_Interval)

                    return speed

  • For determining result firstly the seconds are converted int minutes by multiplying with 60 and number_of_words is divided with Time_Interval in order to get words per minute. The return value will give speed which has data type float.

4 0
3 years ago
Laura is the first person in her SDLC team to detect and predict security vulnerabilities in the software. In which phase is Lau
Eddi Din [679]

Answer:

answer is c

if my answer is wrong than sorry

7 0
3 years ago
Other questions:
  • Questions 1 )When does a spring tide take place?
    14·2 answers
  • The one place where c++ allows aggregate operations on arrays is the input and output of c-strings.
    8·1 answer
  • Given positive integer num_insects, write a while loop that prints that number doubled up to, but without exceeding 100. Follow
    8·1 answer
  • Explain why the game of economics has no winner
    8·1 answer
  • Your friend Margo is considering what type of display to purchase with her new desktop computer and she asks you for advice. You
    14·1 answer
  • If you can name this you get 15 points: ↑↑↓↓←→←→βα
    10·1 answer
  • What is gained by increasing the ritation speed of a disk or cd?​
    9·1 answer
  • How to transfer word 2019 from one computer to another
    12·1 answer
  • Complete the sentence.
    12·2 answers
  • Which artificial intelligence term is used to describe extracting information from unstructured text.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!