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'); (i < 2) && Oka('B'); 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
A B C D B C D

Doubts

Problems

Topic: Java Methods - Parameter Passing And Scope

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App