• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
  • Frits Walraven
  • fred rosenberger
  • salvin francis

few questions ...

Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) Can an applet "test" the system to determine its access
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();
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);
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);
ObjectOutputStream o;
o=new ObjectOutputStream(new File("st"));
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,
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic