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
Identify characteristics of top-down programming design. Choose all that apply.
Eva8 [605]

Answer:

The correct option is;

It is made of one or more modules.

It breaks a task into simpler and simpler steps.

Explanation:

The implementation of top-down programming approach begins from the system defining basic modules and progresses by putting in place intermediate modules that take charge of more detailed and complex activities and processes. The intermediate modules are further streamlined into more specific programming

Therefore, the top-down programming is made of one or more modules that breaks a task into simpler and simpler steps.

3 0
4 years ago
When both inputs of a J-K edge-triggered FF are high and the clock cycles, the output will ________.
shutvik [7]

Answer:

Explanation:

Toggle

5 0
3 years ago
We discussed in class the differences between Ruby and a language like Java. Based on our discussions, when do you feel it would
EleoNora [17]

Answer:

Ruby

It’s not a secret that our company places a bet on this interpreted scripting language created by Yukihiro Matsumoto in the far 1995. A bunch of deep-rooted technologies like Smalltalk, Python, Perl, Ada, C++, and others had an impact on shaping Ruby’s syntax and features. As a result, we got a technology known for elegant and expressive coding, as well as increased flexibility and productivity of development. It means that engineers take pleasure in writing code with Ruby and are not restricted in their vision on how to execute one thing or another.

Java

Despite Railsware’s unhidden preference towards Matsumoto’s brainchild, Java is also a part of our team’s arsenal. For example, we leveraged it together with other technologies within the Philips Directlife project. That’s to say, we know both of them and are happy to use whichever language best suits the task at hand.

In a sign of numerous Java and Ruby differences to be described a bit later, there is one undisputed similarity – they were born in the same year. Nevertheless, since then, Java has come through 11 versions with Java SE 11 as the latest one (compared to the Ruby’s latest release of 2.6.0). The technologies that influenced the creation of Java include C++, Ada 83, Object Pascal and others.

The TIOBE index shows that this compiled programming language overcame C in ranking and holds the first position as of the end of 2018. Moreover, it is a primary technology for Android native app development, which by the way was recently enhanced with Kotlin. Another facet of Java is that it is also an ecosystem of tools including Java Development Kit (JDK) for writing/running/compiling Java code, Java Virtual Machine (JVM) for running software built with Java and JVM languages within the same infrastructure to some degree of interoperability (for example, Kotlin for expressiveness and conciseness, Scala for functional programming, etc.), and Java Runtime Environment (JRE) for running Java apps. The basic points why developers opt for this technology are its reliability, platform independence, and ease of use.

Explanation:

The readers of our blog have already had a chance to get to know the duel of Ruby vs. PHP, as well as the combat Python vs. Ruby vs. Node.js. Today, we have Java vs. Ruby in turn.

Traditionally, we’re going to look at both technologies from a product owner’s perspective, which means learning not only technical differences between the languages, but also their actual use across different projects. Here we go.

Warm-up

Before any competition, the contestants need to warm up. It also happens that this term is used by one of the wrestlers, Java, for the lazy class loading of Java Virtual Machine. So, let’s not step out of line and have the competitors spiffed up to the battle.

Ruby

It’s not a secret that our company places a bet on this interpreted scripting language created by Yukihiro Matsumoto in the far 1995. A bunch of deep-rooted technologies like Smalltalk, Python, Perl, Ada, C++, and others had an impact on shaping Ruby’s syntax and features. As a result, we got a technology known for elegant and expressive coding, as well as increased flexibility and productivity of development. It means that engineers take pleasure in writing code with Ruby and are not restricted in their vision on how to execute one thing or another.

At the same time, this technology cannot be called popular. According to the TIOBE index as of December 2018, it is ranked 17th. Nevertheless, the language is not dying and keep afloat with the 3.0 version expected to be released in 2020. To sum up, Ruby allows programmers to enjoy what they do and be productive at once by following the principle of least astonishment.

Ruby key features

Apart from comparing Ruby to Java, let’s take a look at some key things one should know about this gem of a language.

Open-source

Interpreted language

Multi-platform

Dynamic + duck typing

Has a smart garbage collector

Everything including methods, numbers and variable is an object

You can embed Ruby into HTML

High scalability

Applicable for writing CGIs, building web and intranet apps

Support of different GUI tools including OpenGL, Tcl/Tk, and GTK

Support of Sybase, Oracle, MySQL, and DB2 connection

4 0
4 years ago
True or False: You should only use your mirrors to see behind you when parallel parking.
mafiozo [28]
False. You should always look /check ou tall mirrors periodicly
8 0
3 years ago
Read 2 more answers
Corinne is taking a chemistry class in college. A lab assignment asks students to track the melting point of ten different subst
Dmitrij [34]

Answer:

a spreadsheet

Explanation:

The data is of statistical type and is experimentally based. And hence, the spreadsheet is the best kind of software that can be used to register the record. And we can save 10 such experient results with the same format of tables on 10 different worksheets, and if we want we can adjust the readings of the 10 similar experiments at one time. And hence, we can quite effectively record as well as analyze this data on the spreadsheet. Hence, the spreadsheet is the correct option.

4 0
3 years ago
Other questions:
  • Is it save too say that any job you apply for or are eligible for has to have some type of technology?
    6·2 answers
  • Which software would you use to create a print design?
    8·2 answers
  • You must obey any special signs or instructions as you pass a construction zone.
    14·2 answers
  • Which of the following is a device that plugs in a usb port on the computer or mobile device and contains multiple usb ports?
    9·1 answer
  • Which of these pieces of hardware is used for telecommunication
    12·2 answers
  • ICMP
    12·1 answer
  • How do i skip direct instruction on e2020?
    11·2 answers
  • In this problem, you will fill in the code for a function count_digits(val) that takes a positive integer, val, and returns a li
    12·1 answer
  • This study highlights that people access social networking sites to be
    12·1 answer
  • Can people survive without technology?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!