Skip to content

// Anna University, Chennai / 2019

Anna University — Object Oriented Programming (CS8392), April/May 2019

Object Oriented Programming · CS8392 · R2017 · B.E. Computer Science and Engineering

Files open in a new tab. Use your browser's download or save option to keep a copy.

Work through the questions

16 questions

No verified answers are available for this paper.

  1. Question 1

    Part ADescriptive2 marks

    Object-Oriented Programming

    Can a Java source file be saved using a name other than the class name? Justify.

    No verified answer or solution is available for this question.

  2. Question 2

    Part ADescriptive2 marks

    Object-Oriented Programming

    What are inline functions? Give examples.

    No verified answer or solution is available for this question.

  3. Question 3

    Part ADescriptive2 marks

    Object-Oriented Programming

    State the conditions for method overriding in Java.

    No verified answer or solution is available for this question.

  4. Question 4

    Part ADescriptive2 marks

    Object-Oriented Programming

    Write the syntax for importing packages in a Java source file and give an example.

    No verified answer or solution is available for this question.

  5. Question 5

    Part ADescriptive2 marks

    Object-Oriented Programming

    What happens when the statement: int value = 25/0; is executed?

    No verified answer or solution is available for this question.

  6. Question 6

    Part ADescriptive2 marks

    Object-Oriented Programming

    Give an example for reading data from files using File Input Stream.

    No verified answer or solution is available for this question.

  7. Question 7

    Part ADescriptive2 marks

    Object-Oriented Programming

    Sketch the lifecycle of a thread.

    No verified answer or solution is available for this question.

  8. Question 8

    Part ADescriptive2 marks

    Object-Oriented Programming

    Give the syntax of a generic class with an example.

    No verified answer or solution is available for this question.

  9. Question 9

    Part ADescriptive2 marks

    Object-Oriented Programming

    Write the class hierarchy for panel and frame.

    No verified answer or solution is available for this question.

  10. Question 10

    Part ADescriptive2 marks

    Object-Oriented Programming

    State the purpose of getRed( ), getBlue( ) and getGreen( ) methods.

    No verified answer or solution is available for this question.

  11. Question 11

    Part BDescriptive13 marks

    Object-Oriented Programming

    (a) (i) Discuss the three OOP principles in detail. (7) (ii) What are literals? Explain the types of literals supported by java. (6) (OR) (b) (i) Explain the selection statements in Java using suitable examples. (7) (ii) Write a Java code using do-while loop that counts down to 1 from 10 printing exactly ten lines of 'hello'. (6)

    No verified answer or solution is available for this question.

  12. Question 12

    Part BDescriptive13 marks

    Object-Oriented Programming

    (a) Explain hierarchical and multi-level inheritances supported by Java and demonstrate the execution order of constructors in these types. (13) (OR) (b) (i) Explain simple interfaces and nested interfaces with examples. (7) (ii) Present a detailed comparison between classes and interfaces. (6)

    No verified answer or solution is available for this question.

  13. Question 13

    Part BDescriptive13 marks

    Object-Oriented Programming

    (a) (i) Give an example for nested try statements in Java source file and explain. (7) (ii) Write a note on built-in exceptions. (6) (OR) (b) Create an IN file in Java to store the details of 100 students using a STUDENT class. Read the details from IN file, convert all the letters in IN file to lowercase letters and write it into OUT file. (13)

    No verified answer or solution is available for this question.

  14. Question 14

    Part BDescriptive13 marks

    Object-Oriented Programming

    (a) Describe the creation of a single thread and multiple threads using an example. (13) (OR) (b) (i) Using an example, explain inter-thread communication in Java. (7) (ii) Write a generic method for sorting an array of integer objects. (6)

    No verified answer or solution is available for this question.

  15. Question 15

    Part BDescriptive13 marks

    Object-Oriented Programming

    (a) (i) Use graphics objects to draw an arc and a semicircle inside a rectangular box. (4) (ii) Sketch the hierarchy of Java AWT classes and methods. Create a 'checkbox' using these classes and methods. (9) (OR) (b) (i) State the differences between AWT and swing. (4) (ii) Present the hierarchy of Java swing classes and methods of component class. Create a simple 'combo box' in Java swing using the classes and methods. (9)

    No verified answer or solution is available for this question.

  16. Question 16

    Part CDescriptive15 marks

    Object-Oriented Programming

    (a) The following is a system that can be used to synchronize threads. In some shops a machine issues numbered tickets to customers and customers are served in numeric order. * A ticket machine holds an integer, initially zero, and has a single atomic operation: turn( ) - which increments the integer and returns its previous value. * A scheduler also holds an integer, initially zero, and has two atomic operations: next( ) - which increments the integer count queue(value) - suspends the calling thread until the count is atleast as large as the value given as an argument Given a ticket machine, m, and a scheduler, s, a critical region could then be coded as follows: number = m.turn( ); s.queue(number); protected code s.next( ); Write Java classes Ticket Machine, with a turn method, and Scheduler, with next and queue methods to implement the system. (OR) (b) Define Java classes of your own without using any library classes to represent linked lists of integers. Provide it with methods that can be used to reverse a list and to append two lists.

    No verified answer or solution is available for this question.

Keep preparing

Revisit another year or explore a different paper in the library.

More from this exam