- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the type conversion operator ( ) in Java and how to use it?
Cast operator in java is used to convert one data type to other.
Example
public class Sample { public static void main(String args[]) { double d = 20.3; int i = (int)d; System.out.println(i); } }
Output
20
- Related Articles
- What is type conversion in java?
- What is the importance of '+' operator in type conversion in JavaScript?
- What is Type Conversion?
- What is the difference between type conversion and type casting in C#?
- What is the ‘if’ statement in Java and how to use it?
- What is Type conversion in C#?
- What is method hiding in Java and how to use it?
- What is the ‘if else’ statement in Java and how to use it?
- What is the ‘nested if’ statement in Java and how to use it?
- How to use the instanceof operator in Java?
- What is a break statement in Java and how to use it?
- What is a continue statement in Java and how to use it?
- How to implement integer type conversion in JShell in Java 9?
- What is the difference between implicit and explicit type conversion in C#?
- What is a switch case statement in Java and how to use it?

Advertisements