4) 12
As well as the binary OR objective this questions requires you to understand the octal notaction which means that the leading letter zero (not the letter O)) means that the first 1 indicates the number contains one eight and nothing else. Thus this calculation in decimal mean
8|4
To convert this to binary means
1000
0100
��
1100
��
Which is 12 in decimal
The | bitwise operator means that for each position where there is a 1, results in a 1 in the same position in the answer.
________________________________________
Answer 48)
Objective 5.1)
2)s+=i;
Only a String acts as if the + operator were overloaded
________________________________________
Answer 49)
Objective 10.1)
Although the objectives do not specifically mention the need to understand the I/O Classes, feedback from people who have taken the exam indicate that you will get questions on this topic. As you will probably need to know this in the real world of Java programming, get familiar with the basics. I have assigned these questions to Objective 10.1 as that is a fairly vague objective.
1) File f = new File(“/”,”autoexec.bat”);
2) DataInputStream d = new DataInputStream(System.in);
3) OutputStreamWriter o = new OutputStreamWriter(System.out);
Option 4, with the RandomAccess file will not compile because the constructor must also be passed a mode parameter which must be either “r” or “rw”
________________________________________
Answer 50)
Objective 5.1)
1)o1=o2;
2)b=ob;
4)o1=b;
________________________________________
Answer 51)
Objective 5.4)
4) 10,0,20
In the call
another(v,i);
A reference to v is passed and thus any changes will be intact after this call.
________________________________________
Answer 52)
Objective 6.2)
SCJP Practice questions – 1
Share this Article :
