Question:What is the output of the given program?
public class Test93 {
        private int x = 0;

        public static void main(String[] args) {
                new Test93().test();
        }

        private int f(int x) { return ++x; }
        private int g(int y) { return x++; }

        private void test() {
                System.out.print( f(x)==f(x) ? "f" : "#" );
                System.out.print( g(x)==g(x) ? "g" : "#" );
        }
}
 

A ## 

B #g 

C f# 

D fg 

+ Answer
+ Report
Total Preview: 2482

Copyright © 2024. Powered by Intellect Software Ltd