java (6) questions

foooq55

  

1) Ex 2.1

What is te differnc between the literals 4,4.0, ‘4’, and “4”?

2) Ex 2.3

What output is produced by the following code fragment? Explain.

System.out.print(“Here we go!”)

System.out.print(“12345”)

System.out.print(“Test this if you are not sure.”):

System.out.print(“Another.”)

System.out.println():

System.out.println(“All done.”)

3) Ex 2.4

What is wrong with the following program statement? How can it be fixed?

System.out.println(“To be or not to be, that is the question.”)

4) Ex 2.8

What value is contained in the floating point variable depth after the following statemts are executed?

depth = 2.4;

depth = 2 - depth * 4;

depth = depth / 5;

  • 8 years ago
  • 20
Answer(3)

Purchase the answer to view it

NOT RATED
  • Chapter2ExerciseSolutions.docx

Purchase the answer to view it

NOT RATED
  • solution_1.docx

Purchase the answer to view it

NOT RATED
  • JAVA.txt