 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Convert Double to Integer in Java
At first, initialize a double value −
double val = 978.65;
Now, convert the Double to Integer value using intValue() method −
Double d = new Double(val); int res = d.intValue();
Example
Following is the program to convert Double to Integer in Java −
public class Demo {    public static void main(String args[]) {       double val = 978.65;       System.out.println("Double = "+val);       Double d = new Double(val);       int res = d.intValue();       System.out.println("Double to Integer value = "+res);    } }  Output
Double = 978.65 Double to Integer value = 978
Advertisements
 