Microsoft Java Written Test

Java

1. How do you find the size of a java object (not the primitive type) ?

ANS. type cast it to string and find its s.length()

2. Why is multiple inheritance not provided in Java?

3. Thread t = new Thread(); t.start(); t = null; now what will happen to the created thread?

4. How is garbage collection done in java?

5. How do you write a "ping" routine in java?

6. What are the security restrictions on applets?
Graphics

1. Write a function to check if two rectangles defined as below overlap or not. struct rect { int top, bot, left, right; } r1, r2;

2. Write a SetPixel(x, y) function, given a pointer to the bitmap. Each
pixel is represented by 1 bit. There are 640 pixels per row. In each
byte, while the bits are numbered right to left, pixels are numbered left
to right. Avoid multiplications and divisions to improve performance.

Questions by Beena   answers by Beena

Showing Answers 1 - 2 of 2 Answers

chandrasekhar Acharya

  • Jun 3rd, 2006
 

. Why is multiple inheritance not provided in Java?

3. Thread t = new Thread(); t.start(); t = null; now what will happen to the created thread?

4. How is garbage collection done in java?

5. How do you write a "ping" routine in java?

6. What are the security restrictions on applets?
Graphics

1. Write a function to check if two rectangles defined as below overlap or not. struct rect { int top, bot, left, right; } r1, r2;

THANGARASU.N

  • Jul 15th, 2011
 

4. storage memory allocation can be used in the garbage collection finalize also used in the garbage collection polymorphism also used in the run time entities in virtual functions of garbage collection

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions