Thursday, March 11, 2010

Java Programing

0 comments

Java Programing


PART-A

1. The range of char datatype in java is from ____to _______.
2. What is the value of int variable a after execution of the following program segment.
      Int a =-1 : a = a >>> 24 :
3. Give an example of short circuit operator in java.
4. Consider the following java program segment.
          Count=0;
               For (I=0;I<10;I++)
               For(j=0;j;j++)
          System.out.println(count);
What is outputted after the execution of the above ?
5. Give java declaration for creation of 10 * 10 int array.
6. A(n) _____is an instance of a class
7. What is the effect of assigning one object reference variable to another object reference variable.
8. _______class is highest level class in inheritance hierarchy of java.
9. In java, objects are passes to the functions by _______
10. To refer static variables in java, you need to specify the name of their ____ followed by dot operator.
11. One can not instantiate objects of _________classes.
12. _____key word is used to prevent a class from being inherited.
13. Which of the following are true ? (There can be more than one answer. List all of them )
     i) in java, constructors are called in the order of derivation. That is from super class to subclass.
     ii) Protected methods can be accessed from non-subclasses of the same package.
     iii) A class can implement more than one interface.
      iv) Java interpreter generates machine language code.
14. What is an unchecked exception ?
15. _____methods are a convention whereby static methods in a class returns an instance of that class.
16. What is a type wrapper ?
17. A ________ is an object that stores association between keys and values.
18. What is meant by serializatoin ?
19. ________ method of applet is called when web browser leaves the HTML document.
20. Give any two examples of when Action Event is generated.
21. What is the purpose of Font Metrics class ?
22. ______is the default layout manager in java.
23. What is meant by remote method invokation ?
24. _______are java programs that execute on the server side of a web server.
25. What is a java bean ?

PART - B

UNIT-I

2. Write java class Bank Account with instance variables account No, name, and balance and constructor methods , deposit (int amount) and withdrawal (int amount). Withdrawal of an amount is permitted only when the balance is more that the amount.

OR

3. Write java class circle with constructor methods and methods for finding area and circumference. Write a main program to instantiate two circles with radii of 10 and 20 and output their areas and circumferences.

UNIT-II

4. Write java abstract class shape with a method Area() and two derived classes Rectangle and circle. Using these classes demostrate dynamic method despatch.

OR

5. Using threads, write java program for producer-consumer problem with n buffers.

UNIT-III

6. List and explain standard collection classes along with their inheritance hierarchy in java.

OR

7. List and explain various character stream classes in java.

UNIT -IV
Yes No Cancel
8.Write java applet to generate the following screen.

OR

9. Write java applet to display an image sample.jpg.

UNIT-V

10. a) List out the advantages of java beans 6m

b) Write short notes on Remote method invocation procedure 4m

OR

11 With an aid of a simple example, explain the key concepts of servelets.
.

0 comments:

Post a Comment

You IP Address

IP