What output is produced by the following statement? Explain.

```
System.out.println ("50 plus 25 is " + 50 + 25);
```

The output produced is:

50 plus 25 is 5025

First the string “50 plus 25 is ” is concatenated with the integer 50; since one of the operands is a string, the result is a string. Then the string “50 plus 25 is 50” is concatenated with the integer 25, producing the final result.

Computer Science & Information Technology

You might also like to view...

Active Directory Administrative Center is not installed by default when the Active Directory Domain Services (AD DS) role is installed via Server Manager or when Remote Server Administration Tools are installed

Indicate whether the statement is true or false

Computer Science & Information Technology

Suppose class Child is derived from class Parent that was in turn derived from class GrandParent. This question concerns order of calls to constructors and destructors for these three classes. Declare an object of class Child. We know that Child, Parent and GrandParent constructors are called. In what order are these constructors are called? When the time comes to destroy the class Child object, we know that Child, Parent and GrandParent destructors are called. In what order are these destructor called?

What will be an ideal response?

Computer Science & Information Technology