Convert double to integer through Math class. If you want to convert the type, you can do it through forced type conversion, as shown below:
Knowledge expansion:
Java is An object-oriented programming language not only absorbs the various advantages of the C++ language, but also abandons the difficult-to-understand concepts such as multiple inheritance and pointers in C++. Therefore, the Java language has two characteristics: powerful functions and simple and easy to use. As a representative of static object-oriented programming languages, Java language perfectly implements object-oriented theory and allows programmers to perform complex programming with an elegant way of thinking.