Ask Question
2 March, 07:50

Write down the result of each expression in the output column and specify the datatype of the result. Datatype should follow the Java Standards. If the output is a String, surround it with " "; if the output is char surround it with ' '. Floats should have an 'f' or 'F' at the end, longs should have an 'L' or 'l' at the end (generally avoid using lowercase 'l' because it can be confusing).

+5
Answers (1)
  1. 2 March, 08:05
    0
    Kindly check the explanation section.

    Explanation:

    Below are the expression given in the question and the corresponding output and Datatype.

    (1). Expression = 7/2 + 9.2/2.

    Output = 7.6, Datatype = double

    (2). Expression = 3.4 + 2 5 f.

    Output = 5.9, Datatype = double.

    (3). Expression = "whale". Substring (2,5).

    Output = "ale", Datatype = string.

    (4). Expression = (int) 9.2 + 6.0 f.

    Output = 15.0 f, Datatype = float.

    (5). Expression = (2 < = 1) && (5! = 2) || (8 + 5! = 13).

    Output = false, Datatype = boolean

    (6) Expression = 1.5 f = = 1.5?.

    Output: "false", Datatype : "true "

    Output = "false",

    Datatype = String.

    (7). Expression = "joey". charAtt (4).

    Output = error, Datatype = error".

    (8). Expression = madmax".

    indexOf ("a") + 7.

    Output: 8, Datatype = int.

    (9). Expression = 2 + 3 + "catdog" + 1 + 2.

    Output = "5catdog12", Datatype = String.

    (10). Expression = String. format ("%3.3f",7.89672).

    output = "7.897", datatype = String.

    (11). Expression = "captain". indexOf ("a", 2).

    Output = 4, datatype = int.

    (12). true? + +3: 3++.

    Output = error, dataty = error.

    (13). Expression = new String[]{"tony","josh"}[0].

    Output = "tony", Datatype = String.

    (14). Expression = "patrick". substring (2) + "lucky". substring (4).

    Output = "tricky", Datatype = String.

    (15). Expression = "popFizz". indexOf ("o") + 2.4 + 6L.

    Output9.4, Datatype = double.

    (16). Expression = "pizza". indexOf ("z").

    Output = 2, Datatype = int.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write down the result of each expression in the output column and specify the datatype of the result. Datatype should follow the Java ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers