Home » JAVA Programming » Methods » Question
  1. What is the output of this program?
    public class Result
    {
    public static void main(String args[])
    {
    Double num = new Double(260.062);
    int p = num.intValue();
    System.out.print(p);
    }
    }
    1. 260.062
    2. 260
    3. 260.06
    4. 260.0
    5. 260.260
Correct Option: B

num.intValue() method returns the value of wrapper i as a Integer. num is 260.062 is double number when converted to an integer data type its value is 260.



Your comments will be displayed only after manual approval.