What is the result of the following code execution?

abstract class Test{
    private static int getHalf(int i){
        return i/2;
    public static void main(String[] str){
        int half=getHalf(0);
        System.out.println("Result is:"+half);
Abstract class may contain none of the abstract methods. If instances of this class are not created, the code will compile and execute.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback