IT234 Object Oriented Programming With Java

Object Oriented Programming With Java TU Board 2024 question paper

22 questionsSit this paper (timed)

Tribhuvan University

Bachelor of Information Technology Management

Semester 2 · TU Board 2024

Course Title: Object Oriented Programming With Java (IT234)

Full Marks: 60Pass Marks: 30Time: 3 Hrs

Candidates are required to give their answers in their own words as for as practicable.

Group A

Brief Answer Questions(10 × 1 = 10)

  1. 1.

    What will convert Java code to byte code?

    1
  2. 2.

    How does for each different with for loop?

    1
  3. 3.

    Define package.

    1
  4. 4.

    Differentiate between error and exception.

    1
  5. 5.

    What is generic programming?

    1
  6. 6.

    Define type casting.

    1
  7. 7.

    What is the name of class that is base class for all implicit and explicit classes?

    1
  8. 8.

    When do you use inner class?

    1
  9. 9.

    Can you convert float to integer implicitly?

    1
  10. 10.

    What is the role of static field?

    1

Group B

Short Answer Questions: (Attempt any FIVE Questions)(5 × 3 = 15)

  1. 11.

    How do you handle big numbers? Illustrate with an example.

    3
  2. 12.

    Write a Java program to find the value of aᵇ for given a and b.

    3
  3. 13.

    "Java is architecture-neutral language". Does this statement conflict with JVM? Give your opinion.

    3
  4. 14.

    Write a Java program that declares and initializes an integer array of size 15 and display only the perfect square integer.

    3
  5. 15.

    Do we need to define default constructor all the time? Justify.

    3
  6. 16.

    Write a Java program to display the sum of 5 numbers using generic method.

    3

Group C

Long Answer Questions: (Attempt any THREE Questions)(3 × 5 = 15)

  1. 17.

    Why do we need wrapper class? Illustrate with an example.

    5
  2. 18.

    Write a program to create your own exception as invalid string such that when the string given by user is of odd length.

    5
  3. 19.

    Write a program to read an integer and if the integer is positive write it to the file "pos.dat" otherwise "neg.dat".

    5
  4. 20.

    Create a class named college with instance variables cname and crank. Add a method named setCollege with parameters name and rank. Add another method named showRecord to display values of these variables. Now derive a class named student with member variables name and roll. Also add two methods setStudent and displayRecord to set parameters and to display records respectively in student. Now in main (), declare 4 objects of student and display the records of student whose name ends with "ra".

    5

Group D

Comprehensive Answer / Case / Situation Analysis Questions(2 × 10 = 20)

  1. 21.

    Can you imagine Java Program without this pointer? What is the role of this super keyword? Write a program to create following types of multidimensional array and print the values as follows.

    123456

    10
  2. 22.

    Differentiate between concrete class and abstract class. Why the process of implementing multiple inheritance using concrete classes is prohibited in Java and how it can be solved using interface? Explain.

    10

— The End —