Tuesday, April 21, 2009

Unit I


  1. Write a program that will compute the following series:
    (a) 1/1 + 1/2 + 1/3 + ...... + 1/n [
    Exam Tip]
    (b) 1/1 + 1/2 + 1/22+ ....... + 1/2n. [Exam Tip]
    [April 07 Set 1][April 07 Set 3][Sep 07 Set 3][April 08 Set 4]

  2. (a) What are conventional styles for class names, method names, constants and variables? [Exam Tip]
    (b) Can a java run on any machine? What is needed to run java on a computer?
    [Exam Tip]
    (c) Explain the concept of keywords. List some java keywords. [Exam Tip]
    [April 07 Set 2]

  3. (a) Describe the genesis of java. Also write brief overview of java [Exam Tip]
    [April 08 Set 1,Set 2,Set 3]
    (b) List and explain the control statements used in java. Also describe the syntax of the control statements with suitable illustration. [Exam Tip]
    [April 07 Set 4]

  4. (a) java is freeform language. Comment [Exam Tip]
    (b) Describe in detail the steps involved in implementing a stand-alone program.
    [Exam Tip]
    (c) What are command line arguments? How are they useful? [Exam Tip]
    [Sep 07 Set 1][Sep 07 Set 4]

  5. (a) When dealing with very small or very large numbers, what steps would you take to improve the accuracy of the calculations [Exam Tip]
    (b) What are symbolic constants? How are they useful in developing programs?
    [Exam Tip]
    (c) Write a program to determine the sum of the following harmonic series for a given value 1 + 1/2 + 1/3 + ..... + 1/n The value of n should be given interactively through the keyboard. [Exam Tip]
    [Sep 07 Set 2]

  6. Write a program that will read an unspecified number of integers and will determine how many positive and negative values have been read. Your program ends when the input is 0.[Exam Tip]
    [Apr 08 Set 1]

  7. Write a program to convert the given temperature in Fahrenheit to Celsius using the following conversion formula C = (F - 32)/1.8 And display the values in a tabular form.[Exam Tip]
    [Apr 08 Set 2,Set 3]




Unit II



  1. (a) What is an array? Why arrays are easier to use compared to a bunch of related variables? [Exam Tip]
    (b) Write a program for transposition of a matrix using arraycopy command.
    [Exam Tip]
    [April 07 Set 1][April 07 Set 3][April 08 Set 3]

  2. (a) What is a constructor? What are its special properties? [Exam Tip]
    (b) How do we invoke a constructor? [Exam Tip]
    (c) What are objects? How are they created from a class?
    [Exam Tip]
    [April 07 Set 2][April 08 Set 1][April 08 Set 4]

  3. (a) What is class? How does it accomplish data hiding? [Exam Tip]
    (b) How do classes help us to organize our programs? [Exam Tip]
    (c) Compare and contrast overloading and overriding methods. [Exam Tip]
    [April 07 Set 4][Sept 07 Set 3]

  4. (a) How does String class differ from the StringBuffer class? [Exam Tip]
    (b) Write program to do the following:
    i. To output the question “who is the inventor of java”?
    ii. To accept an answer
    iii. To print out “Good” and then stop, if the answer is correct.
    iv. To output the message “try again”, if the answer is wrong
    v. To display the correct answer when the answer is wrong even at the third attempt. [Exam Tip]
    [Sept 07 Set 1]

  5. Briefly explain following:
    (a) final & this keywords [Exam Tip]
    (b) garbage collection [Exam Tip]
    (c) passing parameter-call by value [Exam Tip]
    (d) Overloading methods & Constructors. [Exam Tip]
    [Sept 07 Set 2]

  6. (a) What is the difference between equality of objects and equality of objects and equality of references that refer to them? [Exam Tip]

    (b) What is the difference between a public member and a private member of a class? [Exam Tip]

    (c) write an application that computes the value of ex by using the formula:
    ex = 1 + x/1! + x2/2! + x3/3! + .......... [Exam Tip]
    [Sept 07 Set 4]

  7. (a) What is the purpose of using a method? How do you declare a method? How do you invoke a method? [Exam Tip]

    (b) What is method overloading? Can you define two methods that have same name but different parameter types? Can you define two methods in a class that have identical method names and parameter profile with different return value types or different modifier ? [Exam Tip]
    [April 08 Set 2]



Unit III



  1. Create an abstract class with no methods. Derive a class and add a method. Create a static method that takes a reference to the base class, downcasts it to the derived class, and calls the method. In main( ), demonstrate that it works. Now put the abstract declaration for the method in the base class, thus eliminating the need for the downcast. [Exam Tip]
    [April 07 Set 1][April 07 Set 2]

  2. Is there any alternative solution for Inheritance. If so explain the advantages and disadvantages of it. [Exam Tip]
    [April 07 Set 3]

  3. Explain about Object class in detail. [Exam Tip]
    [April 07 Set 4][April 08 Set 4]

  4. Create an inheritance hierarchy of Rodent: Mouse, Gerbil, Hamster, etc. In the base class, provide methods that are common to all Rodents, and override these in the derived classes to perform different behaviors depending on the specific type of Rodent. Create an array of Rodent, fill it with different specific types of Rodents, and call your base-class methods. Explain the output. [Exam Tip]
    [Sept 07 Set 1][Sept 07 Set 4]

  5. What are the types of inheritances in java? Explain each of them in detail. [Exam Tip]
    [Sept 07 Set 2][Sept 07 Set 3]

  6. (a) Explain about final classes,final methods and final variables? [Exam Tip]
    (b) Explain about the abstract class with example program? [Exam Tip]
    [April 08 Set 1]


  7. Add a new method in the base class of Shapes.java that prints a message, but don’t override it in the derived classes. Explain what happens. Now override it in one of the derived classes but not the others, and Explain what happens. Finally, override it in all the derived classes, Explain in detail about each situation. [Exam Tip]
    [April 08 Set 2]


  8. Create a base class with an abstract print( ) method that is overridden in a derived class. The overridden version of the method prints the value of an int variable defined in the derived class. At the point of definition of this variable, give it a nonzero value. In the base-class constructor, call this method. In main( ), create an object of the derived type, and then call its print( ) method. Explain the results. [Exam Tip]
    [April 08 Set 3]





Unit IV



  1. Write a program to create a private inner class that implements a public interface.Write a method that returns a reference to an instance of the private inner class, upcast to the interface. Show that the inner class is completely hidden by trying to downcast to it. [Exam Tip]
    [April 07 Set 1]

  2. Prove that all the methods in an interface are automatically public. [Exam Tip]
    [April 07 Set 2]

  3. Write a program create an interface U with three methods. Create a class A with a method that produces a reference to a U by building an anonymous inner class. Create a second class B that contains an array of U. B should have one method that accepts and stores a reference to a U in the array, a second method that sets a reference in the array (specified by the method argument) to null and a third method that moves through the array and calls the methods in U. In main( ), create a group of A objects and a single B. Fill the B with U references produced by the A objects. Use the B to call back into all the A objects. Remove some of the U references from the B. [Exam Tip]
    [April 07 Set 3][April 08 Set 3]

  4. Create an interface with at least one method, in its own package. Create a class in a separate package. Add a protected inner class that implements the interface. In a third package, inherit from your class and, inside a method, return an object of the protected inner class, upcasting to the interface during the return. [Exam Tip]
    [April 07 Set 4][Sept 07 Set 2]

  5. Write a program to create a class with a non default constructor and no default constructor. Create a second class that has a method which returns a reference to the first class. Create the object to return by making an anonymous inner class that inherits from the first class. [Exam Tip]
    [Sept 07 Set 1]

  6. Prove that the fields in an interface are implicitly static and final. [Exam Tip]
    [Sept 07 Set 3][April 08 Set 1]

  7. Create three interfaces, each with two methods. Inherit a new interface from the three, adding a new method. Create a class by implementing the new interface and also inheriting from a concrete class. Now write four methods, each of which takes one of the four interfaces as an argument. In main( ), create an object of your class and pass it to each of the methods. [Exam Tip]
    [Sept 07 Set 4]

  8. (a) What is a package? How do we design a package? [Exam Tip]
    (b) How do we add a class or interface to a package? [Exam Tip]
    [April 08 Set 2]


  9. (a) What is interface? Write a program to demonstrate how interfaces can be extended. [Exam Tip]
    (b) What is package? How do you create a package? Explain about the access protection in packages? [Exam Tip]
    [April 08 Set 4]





Unit V



  1. Explain the following exceptions with the help of examples:
    (a) ArithmeticException [
    Exam Tip]
    (b) NullPointerException [Exam Tip]
    (c) NumberFormatException [Exam Tip]
    [April 07 Set 1]

  2. (a) With the help of an example, explain multithreading by extending thread class. [Exam Tip]
    (b) Implementing Runnable interface and extending thread, which method you prefer for multithreading and why. [Exam Tip]
    [April 07 Set 2]

  3. (a) What is the role of stack in exception handling?[Exam Tip]
    (b) Give the classification of exceptions [Exam Tip].
    [April 07 Set 3]

  4. (a) What is the difference between unchecked and checked exceptions in java? [Exam Tip]
    (b) Give the list of different unchecked exceptions in java and their meaning. [Exam Tip]
    (c) Explain in detail any two unchecked exceptions [Exam Tip].
    [April 07 Set 4]

  5. In JAVA, is exception handling implicit or explicit or both. Explain with the help of example java programs. [Exam Tip]
    [Sept 07 Set 1]

  6. (a) Is it possible to achieve true parallelism using multithreading. What are the limitations in it?[Exam Tip]
    (b) What is the role of priorities in multithreading. What are its limitations? How do you set and get priority values for threads in Java. [Exam Tip]
    [Sept 07 Set 2]

  7. (a) Give the Class hierarchy in Java related to exception handling. Briefly explain each class. [Exam Tip]
    (b) What is the necessity of exception handling? Explain exception handling taking “divide-by-zero” as an example. [Exam Tip]
    [Sept 07 Set 3]

  8. (a) What is the meaning of rethrowing an exception? When it is useful.[Exam Tip]
    (b) What are the limitations of exception handling feature of java. [8+8] [Exam Tip]
    [Sept 07 Set 4]


  9. (a) Why thread is called light weight task and process heavy weight task. [Exam Tip]
    (b) What are the different things shared by different threads of a single process. What are the benefits of sharing? [Exam Tip]
    (c) Is multithreading suitable for all types of applications. If yes explain any such application. If no, explain any application for which multithreading is not desired. [Exam Tip]
    [April 08 Set 1]


  10. (a) Define multithreading. Give an example of an application that needs multithreading.[Exam Tip]
    (b) How multithreading in single processor system is different from multithreading in multiprocessor system. Explain.[Exam Tip]
    [April 08 Set 2]


  11. (a) Explain throws statement in Java with the help of an example program. [Exam Tip]
    (b) What is the difference between throw and throws statement. [Exam Tip]
    [April 08 Set 3]


  12. (a) Explain how threads with different priorities execute in environment which supports priorities and which doesn’t support priorities. [Exam Tip]
    (b) what are the functions available in java related to priority. [Exam Tip]
    [April 08 Set 4]





Unit VI



  1. (a) Why creating a subclass of Frame is preferred over creating an instance of Frame when creating a window. [Exam Tip]
    (b) Explain the steps in creating a subclass of frame with the help of examples. [Exam Tip]
    [April 07 Set 1][Sept 07 Set 3]

  2. What are the methods supported by the following interfaces. Explain each of them
    (a) ActionListener interface [Exam Tip]
    (b) MouseMotionListener interface [Exam Tip]
    (c) TextListener interface [Exam Tip].
    [April 07 Set 2]

  3. (a) What is the functionality supported by java related to Fonts.[Exam Tip]
    (b) How using different fonts improves the user interface.[Exam Tip]
    [April 07 Set 3]

  4. What are the methods supported by KeyListener interface and MouseListener interface. Explain each of them with examples. [Exam Tip]
    [April 07 Set 4][April 08 Set 1]

  5. (a) How event driven programming is different from Procedure oriented programming.[Exam Tip]
    (b) Give overview of Java’s event handling mechanism. [Exam Tip]
    [Sept 07 Set 1]

  6. (a) Define Graphics context. How do you obtain graphics context.[Exam Tip]
    (b) Explain in brief different drawing functions of Java. [Exam Tip]
    [Sept 07 Set 2]

  7. (a) What is Delegation Event model? Explain it. What are its benefits?[Exam Tip]
    (b) Define Event. Give examples of events. Define event handler. How it handles events. [Exam Tip]
    [Sept 07 Set 4]

  8. Write a java program which creates human face. [Exam Tip]
    [April 08 Set 2]

  9. (a) Write a java program which draws a dashed line and dotted line using applet. [Exam Tip]
    (b) Write a java program to draw a polygon of eight edges. [Exam Tip]
    [April 08 Set 3]

  10. (a) Why do you use frames? [Exam Tip]
    (b) Explain the syntax and functionality of different methods related to Frames. [Exam Tip]
    [April 08 Set 4]




Unit VII



  1. (a) What is the use of JPasswordField? Explain with an aid of an application program.[Exam Tip]
    (b) What are the differences between JPopupMenu and JMenu? [Exam Tip]
    [April 07 Set 1]

  2. Differentiate following with suitable examples:
    (a) Frame, JFrame [Exam Tip]
    (b) Applet, JApplet [Exam Tip]
    (c) Menu, Jmenu [Exam Tip].
    [April 07 Set 2]

  3. Explain the following:
    (a) Creating an applet [Exam Tip]
    (b) Passing parameters to applets [Exam Tip]
    (c) Adding graphics and colors to applets [Exam Tip].
    [April 07 Set 3]

  4. Explain various methods of Applet class with necessary examples. [Exam Tip]
    [April 07 Set 4]

  5. What are containers? List various containers. Explain the usage of JPanel with example. [Exam Tip]
    [Sept 07 Set 1]

  6. What is JFC? Explain the differences between JTextArea, JTextComponent, JTextField with examples. [Exam Tip]
    [Sept 07 Set 2]

  7. Briefly explain the components of AWT. [Exam Tip]
    [Sept 07 Set 3]

  8. Create an applet with two toolbars. One toolbar should be created using JButtons and a separator and another toolbar should be created using 3 custom Action classes. Add one to the ”north” and another to the ”south” sides of border layout. When the user clicks one of the buttons in the toolbar, it will print a message to the console stating that which button is being pressed from which toolbar. Add functionalities to the buttons such as New, Open, Close, Save, Cut, Copy, Paste. [Exam Tip]
    [Sept 07 Set 4]

  9. Explain the functionality of JComponent with example. Differentiate JComponent and JPanel. [Exam Tip]
    [April 08 Set 1]

  10. What are various JFC containers? List them according to their functionality. Explain each of them with examples. [Exam Tip]
    [April 08 Set 2]

  11. (a) In what way JList differ from JComboBox? [Exam Tip]
    (b) JList does not support scrolling. Why? How this can be remedied? Explain with an example. [Exam Tip]
    [April 08 Set 3]

  12. Explain the steps involved in creating JCheckBox, JRadioButton, JButton, JLabel.[Exam Tip]
    [April 08 Set 4]




Unit VIII



  1. Briefly explain the constructors and methods of StringTokenizer class. [Exam Tip]
    [April 07 Set 1]

  2. Explain connection less client/server interaction with datagrams in detail. Give suitable example.
    [April 07 Set 2]

  3. (a) What is a port? What is the difference between port and socket? [Exam Tip]
    (b) Explain several methods provided by URL? [Exam Tip]
    [April 07 Set 3]

  4. What is StringTokenizer class? What is its use? Write a program to display the course name, course fee & duration of course using StringTokenizer class. [Exam Tip]
    [April 07 Set 4]

  5. (a) How does Random class generate pseudo random numbers? [Exam Tip]
    (b) Write a program to generate a set of random numbers. Find its sum and average. The program should also display * based on the random numbers generated. [Exam Tip]
    [Sept 07 Set 1][Sept 07 Set 3]

  6. (a) Briefly explain String class. [Exam Tip]
    (b) Write a program to count the frequency of words, characters in the given list of text. [Exam Tip]
    [Sept 07 Set 2]

  7. What do you mean by URL? How to create an URL? Explain several methods provided by URL? Give appropriate examples. [Exam Tip]
    [Sept 07 Set 4]

  8. (a) What are accessor methods?[Exam Tip]
    (b) How will you create strings and stringbuffers? How will you modify them? [Exam Tip]
    [April 08 Set 1]

  9. (a) Discuss briefly about the following: TCP, UDP, URL [Exam Tip]
    (b) What is InetAddress? How to create an InetAddress? What is its use? [Exam Tip]
    [April 08 Set 2]

  10. Define sockets. Use socket programming to design a client/server application that takes the password as input and checks whether it is correct. The program should print the appropriate message. [Exam Tip]
    [April 08 Set 3]

  11. Write a program to illustrate the usage of the following methods of StringBuffer class. Explain the output in each case. Delete(), setChatAt(), deleteChatAt(), append(), chatAt(), getChars(). [Exam Tip]
    [April 08 Set 4]