R5312206-oops Through Java

  • Uploaded by: sivabharathamurthy
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View R5312206-oops Through Java as PDF for free.

More details

  • Words: 1,317
  • Pages: 4
1

Code No: R5312206

III B.Tech I Semester(R05) Supplementary Examinations, May/June 2009 OOPS THROUGH JAVA (Instrumentation and Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) List at least ten major differences between C and Java (b) Compare in terms of their functions, the following pairs of statements: i. while and do?.while ii. while and for (c) What is an empty statement? Explain its usefulness.

[4+4+4+4]

2. (a) Briefly explain following: i. nested classes and inner classes ii. Overloading methods & Constructors (b) Write an application program that calculates the product of the odd integers from 1 to 15. [4+4+8] 3. 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. [16] 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. [16] 5. (a) Explain throws statement in Java with the help of an example program. (b) What is the difference between throw and throws statement. 6. Write a java program which creates human face.

[8+8] [16]

7. Give advantages of swings? Write short notes on swing components. Explain swing package. [16] 8. 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(). [16] ?????

2

Code No: R5312206

III B.Tech I Semester(R05) Supplementary Examinations, May/June 2009 OOPS THROUGH JAVA (Instrumentation and Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. Distiguish between the following terms: (a) Objects and classes (b) Data abstraction and data encapsulation (c) Inheritance and polymorphism (d) Dynamic binding and message passing.

[16]

2. (a) What is class? How does it accomplish data hiding? (b) How do classes help us to organize our programs? (c) Compare and contrast overloading and overriding methods.

[4+4+8]

3. 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. [16] 4. 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. [16] 5. (a) Explain how threads with different priorities execute in environment which supports priorities and which doesn’t support priorities. (b) what are the functions available in java related to priority.

[10+6]

6. (a) Define Graphics context. How do you obtain graphics context. (b) Explain in brief different drawing functions of Java.

[6+10]

7. Explain the functionality of JComponent with example. Differentiate JComponent and JPanel. [8+8] 8. What do you mean by URL? How to create an URL? Explain several methods provided by URL? Give appropriate examples. [4+4+8] ?????

3

Code No: R5312206

III B.Tech I Semester(R05) Supplementary Examinations, May/June 2009 OOPS THROUGH JAVA (Instrumentation and Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Describe the genesis of java. Also write brief overview of java. (b) 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. [8+8] 2. (a) What is the difference between equality of objects and equality of objects and equality of references that refer to them? (b) What is the difference between a public member and a private member of a class? (c) write an application that computes the value of ex by using the formula: ex = 1 + x/1! + x2 /2! + x3 /3! + ..........

[4+4+8]

3. Create a 3-level inheritance hierarchy. Each class in the hierarchy should have a finalize( ) method, and it should properly call the base-class version of finalize( ). Demonstrate that your hierarchy works properly. [16] 4. (a) Write a program to create a class with an inner class. In a separate class, make an instance of the inner class. (b) Write a program to create a class with an inner class that has a non default constructor. Create a second class with an inner class that inherits from the first inner class. [16] 5. (a) What is multithreading? What are its advantages? (b) compare process based and thread based multitasking. 6. Explain different event classes supported by Java.

[6+10] [16]

7. Explain the steps involved in creating JCheckBox, JRadioButton, JButton, JLabel. [4+4+4+4] 8. Explain the following: (a) Calendar class (b) Observable class (c) Random class.

[5+5+6] ?????

4

Code No: R5312206

III B.Tech I Semester(R05) Supplementary Examinations, May/June 2009 OOPS THROUGH JAVA (Instrumentation and Control Engineering) Time: 3 hours

Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ?????

1. (a) How is java more secured than other languages? (b) What is multithreading? How does it improve the performance of java? (c) Write a program to find factorial of a given number.

[4+4+8]

2. (a) What is a constructor? What are its special properties? (b) How do we invoke a constructor? (c) What are objects? How are they created from a class? 3. Explain about Object class in detail.

[6+4+6] [16]

4. 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.

[16]

5. (a) What is the significance of main thread in multithreading. Explain with an example how you can control main thread. (b) What is the role of Sleep class in multithreading. Explain.

[10+6]

6. What is Event listener? Explain the different Event Listener interfaces supported by java and their purpose.

[16]

7. Explain the steps involved in creating JMenuBar, JMenu, JMenuItem.

[16]

8. How java supports internet programming? What protocol does it having for that? Does java supports intranet programming? How? Explain each of which with java skeleton code. [5+5+6] ?????

Related Documents


More Documents from ""