aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes few questions ... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "few questions ..." Watch "few questions ..." New topic
Author

few questions ...

Ashish Agnihotri
Ranch Hand

Joined: Nov 16, 2000
Posts: 45
1) Can an applet "test" the system to determine its access
rights?
2) What is purpose of java.text.package?
Is it only to do with formatting ( geographical locations ) ?
3) Does following seem to be a bit tricky one ? To me it did�
class A {

private int x=0;
public synchronized void update() { x++;}

public class B {
public synchronized void update() {
synchronized (A.this) { x++; }
}
}
}
What would happen if the following code was executed: and why ?
A a = new A();
A.B b = a.new B();
b.update();
1) �b" would acquire its own monitor and then increment "x"
2) There would be a compiler error
3) would acquire its own monitor and update "x"
4) would acquire the monitor of "a" and increment "x"
5) would acquire both the monitors of "a" and "b" and
increment "x"

4) See following and answer ...
double dd;
java.util.Random r = new Random(33);
dd = r.nextGaussian();
After execution, double dd contains a value that is distributed approximately ________ with a standard deviation of ________ and mean of ________.
I put in uniformly, 1, 33 resp.. but its wrong I know.. can somebody put correct answers ?
5) What is JAVAKEY TOOL ? What is its purpose ?
6) See following code :
public int m1(int x) {
int count=1;
try {
count += x;
count += m2(count);
count++;
}
catch(ArithmeticException e) { count -= x; }
finally { count += 3; }
return count;
}
What happens when m1(2) is invoked ?
7) Which statement would cause a thread to relinquish control of an object's monitor to other threads until "condition" is satisfied?
do { Thread.yield() } while(!condition);
while(!condition) { wait(); }
8) What code will store StringBuffer "str" in file "st"?
FileOutputStream f=new FileOutputStream("st");
ObjectOutputStream o;
0 = new ObjectOutputStream(f);
o.writeObject(str);
ObjectOutputStream o;
o=new ObjectOutputStream(new File("st"));
o.writeObject(str);
I have my own answer for all but one ! but am not still feeling confident of making it public. May be will be capable of doing it shortly..
tks in advance,
Ashish
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: few questions ...