USN BPLCKC105/ BPLCK105C
First Semester B.E./B.Tech. Degree Examination, June/July 2023
Basics of Java Programming
Time: 3 hrs. Max. Marks: 100
Note: 1. Answer any FIVE full questions, choosing ONE full question from each module.
2. M : Marks , L: Bloom’s level , C: Course outcomes.
Module – 1 M L C
Q.1 a. Explain the concept of object oriented programming. 8 L2 CO3
b. Discuss the various primitive Data types used in Java. 6 L2 CO1
c. How “Compile once, run anywhere anytime” is implemented in Java? 6 L2 CO2
OR
Q.2 a. List and explain any three Java Buzzwords. 6 L1 CO2
b. Describe the concept of bytecode. 6 L2 CO2
c. How are arrays declared and initialized in Java? Explain with suitable 8 L2 CO3
examples.
Module – 2
Q.3 a. What are different types of operators in Java? Explain any three types of 8 L2 CO3
operators with example.
b. Discuss the looping statements in Java. 6 L2 CO2
c. Write a Java program to print the following pattern. 6 L2 CO2
OR
Q.4 a. Explain threeway operator. Illustrate with example. 6 L2 CO2
b. Develop the program in Java to calculate the summation among the 8 L3 CO2
elements of an array using ‘for each’. How ‘foreach’ is different from ‘for’
statement.
c. Write a short note on labelled break and labelled continue. 6 L2 CO1
Module – 3
Q.5 a. What is constructor? Explain its types with example. 6 L2 CO2
b. Create a JAVA class called student with the following details as variables 8 L3 CO3
within it USN, NAME, BRANCH, PHONE, PERCENTAGE. Write a Java
program to create n student objects and print the USN, NAME, BRANCH,
PHONE and PERCENTAGE of these objects.
c. Write a short notes on ‘this’ keyword with example. 6 L2 CO2
OR
Q.6 a. Compare and contrast method overloading and method of overriding. 8 L2 CO1
b. Write a Java program for multiplication of two matrices. 8 L2 CO1
c. Discuss Garbage collection and finalize method. 4 L2 CO2
Module – 4
Q.7 a. Design a super class called staff with details as staffid, Name, Phone, 10 L2 CO2
Salary. Extend this class by writing three subclasses namely Teaching
(domain, publications), Technical (skills) and contract (period). Write a
Java program to read and display at least 3 staff objects of all three
categories.
b. What is inheritance? Discuss different types of inheritance with suitable 10 L2 CO2
example.
OR
Q.8 a. What is super keyword? Explain uses of super keyword with example. 10 L2 CO3
b. Demonstrate dynamic dispatch using Abstract class in Java. 10 L3 CO2
1 of 2
BPLCKC105/ BPLCK105C
Module – 5
Q.9 a. Write the General form of exception handling block. 6 L2 CO2
b. Explain multiple catch clauses in exception with example. 8 L2 CO2
c. Discuss any three Runtime exceptions in Java. 6 L2 CO2
OR
Q.10 a. Write a Java program to read two integers a & b. Compute a/b and print, 10 L2 CO2
when b is not zero. Raise an exception when b is equal to zero. Also
demonstrate working of ArrayIndexOutOfBound Exception.
b. What is package? How to create and import package in Java. Explain with 10 L2 CO4
example.
2 of 2