Roll No. …………………..
BCA–C404
Bachelor of Computer Applications
(Fourth Semester)
EXAMINATION, 2021-22
PROGRAMMING IN JAVA
1
Time : 22 Hours
Maximum Marks : 60
Note : All questions have to be attempted.
Section—A
1. Multiple choice questions : 1 each
(i) Which of the following can be used to fully
abstract a class from its implementation ?
(CO2, BL5)
(a) Objects
(b) Packages
(c) Interfaces
(d) None of the mentioned
(ii) Which of the following methods can be used to
output a sting in an applet ? (CO3, BL5)
(a) display( )
P. T. O.
[2] BCA–C404
(b) print( )
(c) drawString( )
(d) transient( )
(iii) Which of these keywords is used to define
interfaces in Java ? (CO2, BL5)
(a) interface
(b) Interface
(c) intf
(d) Intf
(iv) Predict the output of the following program :
(CO2, BL5)
public class BCA{
public static void main(String[ ] args){
short x = 10;
x = x * 5;
System.out.print(x);
}}
(a) Compile Error
(b) Throws Exception
(c) 1
(d) 241
[3] BCA–C404
(v) Predict the output of the following program :
(CO2, BL5)
public class BCA{
public static void main(String[ ] args){
byte x = 127;
x++;
x++;
System.out.print(x);
}}
(a) – 127
(b) 127
(c) 129
(d) 2
(vi) Arrays in java are : (CO2, BL1)
(a) Classes
(b) Objects
(c) Methods
(d) Variables
(vii) In an instance method or a constructor, „this‟ is a
reference to the current object. (CO2, BL1)
(a) True
(b) False
P. T. O.
[4] BCA–C404
(viii) Identify the corrected definition of a package :
(CO2, BL5)
(a) A package is a collection of classes and
interfaces.
(b) A package is a collection of interfaces.
(c) A package is a collection of methods.
(d) None of the above
(ix) Who developed Java ? (CO1, BL1)
(a) James Gosling
(b) Denis Ritchie
(c) Tim Berners Lee
(d) All of the above
(x) java.aql package is required for database
connectivity. (CO4, BL1)
(a) True
(b) False
(xi) Swing provides more GUI functionalities than
AWT. (CO5, BL1)
(a) True
(b) False
(xii) Predict the output of the following code :
(CO2, BL5)
class BCA
{
public static void main(String ar[ ])
{
[5] BCA–C404
int Integer = 24;
char String = „l‟;
System.out.print(String);
}}
(a) Compile Error
(b) Throws Exception
(c) 1
(d) 241
2. Write short notes on any four of the following : 3 each
(a) Discuss various editions of java. Implement a
create to check input number is even or odd.
(CO1, BL6)
(b) Discuss various data types in Java with their
default size and values. (CO2, BL6)
(c) Discuss Final, Blank Final and Static Final with
example. (CO1, BL6)
(d) Discuss the Exception Class Hierarchy with
suitable diagram. (CO2, BL2)
(e) Discuss Jagged array and create a program for the
same. (CO1, BL5)
Section—B
3. Attempt any two of the following : 6 each
(a) “Java is a secure robust, secure and portable
language.” Justify this statement and discuss key
features of Java. (CO1, BL6)
P. T. O.
[6] BCA–C404
(b) Discuss the concept of abstract class and
interface. Create a program using abstract class.
(CO3, BL6)
(c) Discuss the merits of Swing over AWT. Create a
swing frame with 5 controls on it. (CO4, BL6)
4. Attempt any two of the following : 6 each
(a) Discuss the concept of Method Overloading and
Method Overriding. Implement a program to
achieve method overriding in Java. (CO2, BL6)
(b) Discuss the concept of Exception Handling in
Java. Create a program using try, catch and
finally keywords. (CO3, BL6)
(c) Explain the importance of package. Create a
program using user-define package. (CO2, BL6)
5. Attempt any two of the following : 6 each
(a) Discuss the Layout managers supported by Java.
Create a program to using BorderLayout.
(CO4, BL6)
(b) Explain the importance of JDBC in Java. Discuss
various types of Java drivers supported by Java.
(CO5, BL6)
(c) Create table emp with the following fields :
(CO5, BL6)
(id int(10), name varchar(40), age int (3));
Create a program to insert the data in the above
table using JDBC.
BCA–C404