Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How is down-casting possible in Java?
Yes, a variable can be downcast to its lower range substitute by casting. It may lead to data loss although. See the example below −
Example
public class Tester {
public static void main(String[] args) {
int a = 300;
byte b = (byte)a;
System.out.println(b);
}
}
Output
It will print output as −
44
Advertisements
