Menu
Question Index
...

What will be the output of the following program?

public class King {
    public static void main(String[] args) {
        System.out.print("Output = " + Elephant.step2(2, 3));
    }
    interface Queen {
        float step2(int low, int high);
    }
    interface Pawn {
        float step3(int a, int b, int c);
    }
    abstract class Knight implements Queen, Pawn {
    }
    class Elephant implements Queen {
        public static float step2(int x, int y) {
            return (float)(x * 3);
        }
    }
}


Output = 6f
Output = 6.0
Output = 6.0f
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Advanced Java Programming Concepts

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App