0% found this document useful (0 votes)
789 views3 pages

BCA Java Exam Paper April 2024

Uploaded by

amanyadav672967
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
789 views3 pages

BCA Java Exam Paper April 2024

Uploaded by

amanyadav672967
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2011000104030001

EXAMINATION APRIL 2024


BACHELOR OF COMPUTER APPLICATIONS
(FOURTH SEMESTER)
JAVA PROGRAMMING LANGUAGE

[Time: Three Hours] [Max. Marks: 70]

Instructions: Seat No:


1. Fill up strictly the following details on your answer book
a. Name of the Examination: BACHELOR OF COMPUTER
APPLICATIONS (FOURTH SEMESTER)
b. Name of the Subject: JAVA PROGRAMMING LANGUAGE
c. Subject Code No: 2011000104030001
2. Sketch neat and labelled diagram wherever necessary.
3. Figures to the right indicate full marks of the question.
4. All questions are compulsory.
Student’s Signature

Q.1 Choose the correct option. (Any 10) 10


1) Which statement is true about Java?
A. secure B. robust C. platform Independent D. all of these

2) Which of the following is not a component of JDK?


A. compiler B. browser C. debugger D. interpreter

3) Which of the following C++ feature is not supported by Java?


A. class B. constructor C. destructor D. object

4) What is the range of short data type in Java?


A. -128 to 127 B. -32768 to 32767
C. -2147483648 to 2147483647 D. None of these

5) Which of these operators is used to allocate memory to array variable in Java?


A. malloc B. alloc C. new D. calloc

6) Which of the following type of static is not supported in Java?


A. class B. object C. method D. variable

2011000104030001 [1 of 3]
7) Which of the following is the correct way of implementing an interface Shape
by class Circle?
A. class Circle extends Shape {} B. class Circle implements Shape {}
C. class Circle imports Shape {} D. None of these

8) Which of these method of class String is used to convert a String object to byte
array?
A. convertBytes() B. getBytes()
C. fetchBytes() D. getBytesArray()

9) Which of the following keywords is used for throwing exception manually?


A. finally B. try C. throw D. catch

10) What is value of MAX PRIORITY for a thread?


A. 10 B. 15 C. 20 D. 100

11) Which of the following is a valid method in applet?


A. init() B. start() C. paint() D. All of these

Q.2 Answer the following. (Any 2) 14

1) Differentiate between features of Java and C++.


2) Explain type conversion in Java.
3) Explain bitwise operators.

Q.3 Answer the following with example. (Any 2) 14

1) Explain final keyword.


2) Explain super keyword.
3) What is an interface? Why we need it? Explain differences of interface with
abstract class.

Q.4 Answer the following. (Any 2) 14

1) Give difference between String and String Buffer. Explain any 3 methods of
String Buffer.
2) Explain try, catch and finally blocks with example.
3) What is multithreading? Explain thread states with diagram.

2011000104030001 [2 of 3]
Q.5 Do as directed. (any 3) 18

1) Explain package creation and importing with example.


2) What is use of paint () method? Explain any 3 methods of Graphics class with
example.
3) What is a linked list? Give its advantages. Give differences between singly and
singly circular linked lists.
4) What is inheritance? Which type of inheritance is not supported in Java?
Explain constructors in inheritance.

*****

2011000104030001 [3 of 3]

Common questions

Powered by AI

Multithreading is critical in Java for improving application responsiveness and performance by allowing concurrent execution of multiple computations. Java threads can be in several states such as New, Runnable, Blocked, Waiting, and Terminated, which facilitate orderly and efficient task execution .

Java does not support multiple inheritance to avoid complexity and potential conflicts in method definitions from different parent classes. It achieves similar functionality through interfaces, enabling the implementation of multiple types to emulate behavior analogous to multiple inheritance while maintaining simplicity .

Java's type safety and strict type checking during compile-time require explicit type conversion, or casting, to ensure compatibility between different data types. This reduces runtime type errors and enhances code reliability by making the conversion process explicit and intentional .

Interfaces in Java allow for defining methods that must be implemented by a class, enabling multiple inheritances of method declarations. They are flexible for creating loosely coupled architecture, unlike abstract classes, which can hold concrete methods. This abstraction level minimizes code exploitation and increases modularity .

Java is distinguished by its security, robustness, and platform independence because it is designed to mitigate common security risks, ensures reliably error-free execution, and runs on any device that has the Java Virtual Machine (JVM) installed, allowing developers to write code once and run it anywhere .

The 'getBytes()' method is useful when converting a Java String into a sequence of bytes, typically for encoding processes, writing data to an output stream, or when interoperability with low-level binary data is required. It facilitates tasks like data transfer and encryption .

Linked lists offer dynamic memory allocation, ease of insertion and deletion without reallocating or reorganization, unlike arrays which are fixed size and require contiguous memory allocation. This flexibility makes linked lists more adaptable for applications requiring frequent restructuring .

The 'final' keyword in Java can be used to indicate that variables cannot be reassigned, methods cannot be overridden, and classes cannot be extended. This contributes to code stability by preventing unintended changes and enhances security by enforcing strict and predictable behavior .

Java does not support destructors, a feature in C++, which simplifies memory management by relying on garbage collection instead. This reduces the risk of memory leaks and simplifies object lifecycle management, making Java well-suited for applications that prioritize stability and long-term manageability .

Unlike String, which is immutable, StringBuffer allows for mutable sequences of characters, making it more efficient for operations involving repeated modifications like appends and inserts. Thus, when handling string data with frequent changes, StringBuffer provides significant performance advantages .

You might also like