Header Ads

OCJP Cerification Sample Question Set-1

In this post I am going to provide the sample question set for preparing OCJP Examination.

  1. Question-1
  2. public class operatortest {
    static public void main(String[] Args)
    {
    int i ,j;
    for(i=0;i<3;i  )
     {
     for(j=1;j<4;j  )
     {
     i%=j;
     System.out.print(j);
        }
     }
    }
    }
    
    
Options:
  1. 1 2 3 1
  2. 1 2 3 2
  3. Continue print 1 2 3 1 2 3  and create a infinite loop
  4. Program compile fails at line -2


 To be continued...



Solutions
  1. 3

Powered by Blogger.