Computer Applications
Write two differences between Implicit and Explicit conversion.
Java Operators
12 Likes
Answer
| Implicit Conversion | Explicit Conversion |
|---|---|
| Implicit conversions are automatically performed by the Java compiler. | Explicit conversions are performed by the programmer using the cast operator. |
| Example: long a = 98453670116L; long result; int b = 100; result = a + b; | Example: int a = 10; double b = 25.5; float c = (float)(a + b); |
Answered By
5 Likes
Related Questions
A student executes the following code to increase the value of a variable ‘x’ by 2.
He has written the following statement, which is incorrect.
x = +2;What will be the correct statement?
A. x +=2;
B. x =2;
C. x = x +2;- Only A
- Only C
- All the three
- Both A and C
Identify the operator that gets the highest precedence while evaluating the given expression:
a + b % c * d - e
- +
- %
- -
- *
Evaluate the given expression when the value of a=2 and b=3
b*=a++ - ++b + ++a; System.out.println("a= "+a); System.out.println("b= "+b);