R5411002-oops Through Java

  • July 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 R5411002-oops Through Java as PDF for free.

More details

  • Words: 1,040
  • Pages: 4
1

Code No: R5411002

IV B.Tech I Semester(R05) Regular/Supplementary Examinations, December 2009 OOPS THROUGH JAVA (Electronics and Instrumentation Engineering, Electronics and Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Elaborate the different kinds of bitwise and Boolean logical operators in Java. [8] (b) Write a Java program that will define a class Circle with necessary data members (center and radius) and a method to find the area of the circle and find the area for two different circles. [8] 2. (a) Can constructors in Java be overloaded? If so, illustrate with an example. (b) Discuss the JDK and its components in brief. 3. (a) Write a Java Program to show the use of Abstract classes.

[8] [8] [5]

(b) Explain constructor over loading with an example.

[5]

(c) List out the characteristics of interface.

[6]

4. (a) What is an AWT? What is component object in the java AWT.

[8]

(b) Distinguish between component and container in java AWT.

[8]

5. With an example show the handling of mouse events in JAVA?

[16]

6. Write an applet program to demonstrate the drawing of line, circle, oval rectangle and 3D rectangle. [16] 7. Describe the complete life cycle of a thread with neat block diagram at each stage? [16] 8. Explain the following :

[4X4=16]

(a) Serializable (b) Externalizable (c) DataOutput (d) ObjectOutput ?????

2

Code No: R5411002

IV B.Tech I Semester(R05) Regular/Supplementary Examinations, December 2009 OOPS THROUGH JAVA (Electronics and Instrumentation Engineering, Electronics and Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Define an array. In Java, how the arrays of different dimensions can be created and initialized?[8] (b) Write about the usages of the keyword ‘final’ in Java. 2. (a) What is meant by call by reference? How call by reference can be achieved in Java? (b) Discuss the String class in Java.

[8] [8] [8]

3. (a) What is an interface? What is the major difference between an interface and class.

[8]

(b) Describe the various forms of implementing interfaces. Give examples of java code for each case. [8] 4. Write a program to create 4 x 4 grid and fills it in with the 15 buttons, each lable with its index.[16] 5. (a) Explain the class hierarchy of various window types. (b) Write down any event generators.

[8] [8]

6. Explain the methods used in adding and removing controls such as labels. List with an example.[16] 7. (a) What is ‘Exception handling’ ? Why is it considered as a necessary feature in JAVA?

[8]

(b) Write a program to catch Array Out Of Bounds exception when you enter more number of arguments at the command prompt. [8] 8. Write a Java program to read a list of elements from a data file and store the list in the: (a) the same file

[8]

(b) another file

[8] ?????

3

Code No: R5411002

IV B.Tech I Semester(R05) Regular/Supplementary Examinations, December 2009 OOPS THROUGH JAVA (Electronics and Instrumentation Engineering, Electronics and Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Write down the syntax and execution procedure of different kinds of if statements in Java.

[8]

(b) Write a Java program to find the sum of all elements in the one dimensional array. (Define a class representing array with necessary data members and a method to find the sum) [8] 2. (a) How do we add a class or interface to a package? (b) Write a Java Program to implement nested packages.

[6] [3]

(c) Describe the various ways of implementing interfaces. Give examples of Java code for each case. [7] 3. (a) What are the advantages of inheritance.?

[5]

(b) Explain how the objects are passed as arguments to methods with an example. s

[5]

(c) Write a Java program which will read a text and count all occurrences of a given word.

[6]

4. (a) What is an AWT? What is component object in the java AWT.

[8]

(b) Distinguish between component and container in java AWT.

[8]

5. (a) Explain the class hierarchy of various window types. (b) Write down any event generators.

[8] [8]

6. Explain the Color class and its different functions used in applet programming and also explain the showstatus () method with an applet example. [16] 7. Why exception handling is considered one of the important features in O.O.P. Write your explanation with suitable examples. [16] 8. Explain the following :

[4x4=16]

(a) InputStream (b) OutputStream (c) Reader (d) Writer ?????

4

Code No: R5411002

IV B.Tech I Semester(R05) Regular/Supplementary Examinations, December 2009 OOPS THROUGH JAVA (Electronics and Instrumentation Engineering, Electronics and Control Engineering) Time: 3 hours Max Marks: 80 Answer any FIVE Questions All Questions carry equal marks ????? 1. (a) Discuss the different types of literals available in Java.

[8]

(b) Write about automatic type conversion and explain when casting is needed? [8] 2. (a) What is meant by overloading methods? What are the advantages of overloading concept?

[8]

(b) Write a method find Area that can find the area of the circle/square/rectangle using overloading concept. [8] 3. Write your own versions of the string methods for searching strings.

[16]

4. Write a java program to print the fol1owing frame. The size increases when you move from left to right [16]

A B

AAA BBB B B

AA

5. (a) Explain the class hierarchy of various window types. (b) Write down any event generators.

[8] [8]

6. (a) Explain drawsting method used in applets with an examples.

[8]

(b) Explain the html tag used to execute an applet from a web browser and also explain the different options used in that tag with an example. [8] 7. (a) What are the methods by which we may stop threads? Give example situations. (b) What is the difference between suspending and stopping a thread?

[8] [8]

8. Write a Java program to read a set of sentences from a text file and check the following : (a) Number of vowels

[5]

(b) Number of Words

[5]

(c) Number of characters And produce a formatted report.

[6] ?????

Related Documents