Question:What would be the result of compiling and running the following code class?
public class Test {

 public static void main(String args[]) {

  Test t = new Test();
  t.start();
 }

 public void start() {

  int i = 2;
  int j = 3;
  int x = i & j;
  System.out.println(x);
 }
}
 

A The code will not compile. 

B The code will compile but will give a runtime error. 

C The code will compile and print 2. 

D The code will compile and print 1. 

+ Answer
+ Report
Total Preview: 875

Copyright © 2025. Powered by Intellect Software Ltd