Menu
Question Index
...

What will be the output of the following program?

public class Delta
{
    static boolean Oka(char c)
    {
        System.out.print(c + " ");
        return true;
    }

    public static void main(String[] argv)
    {
        int i = 0;

        for (Oka('A'); Oka('B') && (i < 2); Oka('C'))
        {
            i++;
            Oka('D');
        }
    }
}


A B C D A B C D
A B D C B D C B
A B D C B D C
Compilation Error
Runtime Error

Doubts

Problems

Topic: Static and Non Static Variables - Static and Non Static Methods

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App