515). Which of these methods return a smallest whole number greater than or equal to variable X?

[A]double ceil(double X)
[B]double floor(double X)
[C]double max(double X)
[D]double min(double X)

Show Answer

516). Which of these method returns a largest whole number less than or equal to variable X?

[A] double ceil(double X)
[B]double floor(double X)
[C]double max(double X)
[D]double min(double X)

Show Answer

518). What will be the output of the following Java code?
    class A 
    {
         int x;
         int y;
         void display() 
         {
              System.out.print(x + " " + y);
         }
    }
    class Output 
    {
         public static void main(String args[]) 
         {
             A obj1 = new A();
             A obj2 = new A();
             obj1.x = 1;
             obj1.y = 2;
             obj2 = obj1.clone();
             obj1.display();
             obj2.display();
         }
    }

[A]1 2 0 0
[B]1 2 1 2
[C]0 0 0 0
[D] System Dependent

Show Answer

519). What will be the output of the following Java code?
    class Output 
    {
         public static void main(String args[]) 
         {
             double x = 3.14;  
             int y = (int) Math.abs(x);
             System.out.print(y);
         }
    }

[A]0
[B]3
[C]3.0
[D]3.1

Show Answer

520). What will be the output of the following Java code?
    class Output 
    {
         public static void main(String args[]) 
         {
             double x = 3.14;  
             int y = (int) Math.ceil(x);
             System.out.print(y);
         }
    }

[A]0
[B]3
[C]3.0
[D]4

Show Answer

521). What will be the output of the following Java code?
    class Output 
    {
         public static void main(String args[]) 
         {
             double x = 3.14;  
             int y = (int) Math.floor(x);
             System.out.print(y);
         }
    }

[A]0
[B]3
[C]3.0
[D]4

Show Answer