0% found this document useful (0 votes)
26 views

Emerging Programming Platform - 1714377981374

Uploaded by

maharjanshijal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

Emerging Programming Platform - 1714377981374

Uploaded by

maharjanshijal
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

MID EXAMINATION PAPER

FACULTY : COMPUTER SCIENCE AND FACULTY

COURSE : BACHELORS OF BUSINESS ADMINISTRATION (BBA)

YEAR/SEMESTER : THIRD YEAR / SEMESTER SIX

MODULE TITLE : EPP

CODE :

DATE :

TIME ALLOWED :

Instruction to candidates
1. This question paper has THREE (3) Sections.

2. Answer ALL questions in Section A, MCQ.

3. Answer 5 questions in Section B, MSAQ.

4. Answer 2 questions in Section C, MEQ.

5. No scripts or answer sheets are to be taken out of the Examination Hall.

6. For Section A, answer in the OMR form provided.

Do not open this question paper until instructed


(Candidates are required to give their answers in their own words as far as practicable)
SECTION A
Multiple Choice Questions
Attempt All Questions
[30×1=30]

1. In Java, which keyword is used to indicate inheritance?


(a) extends
(b) inherits
(c) implements
(d) derives

2. What is the purpose of the synchronized keyword in Java?


(a) It indicates that a thread should be stopped.
(b) It ensures only one thread can access a block of code at a time.
(c) It defines a thread-safe class.
(d) It specifies the priority of a thread

3. What is an exception in Java?


(a) A syntax error
(b) A runtime error
(c) A logical error
(d) A compilation error

4. How can you create a new thread in Java?


(a) Using the start() method
(b) Using the new Thread() constructor
(c) Using the createThread() function
(d) Using the run() method

5. A subclass can have multiple superclasses. This is known as:


(a) Multithreading
(b) Multiple inheritance
(c) Multi-level inheritance
(d) Multicast inheritance

6. Which of the following statements about the "super" keyword in Java is true?
(a) It is used to call a method of the superclass.
(b) It is used to create an instance of the superclass.
(c) It is used to access static members of the superclass.
(d) It is used to define a superclass.

7. Which of the following loops is suitable when the number of iterations is known
beforehand?
(a) while loop
(b) do-while loop
(c) for loop
(d) if-else loop

8. Which of the following is not a type of program control structure in Java?


(a) Sequence
(b) Iteration
(c) Decision
(d) Inheritance

9. What is a thread in Java?


(a) A lightweight process
(b) A type of data structure
(c) An input/output operation
(d) A type of variable

10. What is the access modifier used to specify that a method in a subclass should
override a method in the superclass?
(a) private
(b) protected
(c) override
(d) public

11. What is the main purpose of inheritance in Java?


(a) Code reusability
(b) Code encapsulation
(c) Code efficiency
(d) Code polymorphism

12. What is the purpose of the finally block in exception handling


(a) It contains the code that is always executed, regardless of whether an exception is
thrown or not.
(b) B. It is used to catch and handle exceptions.
(c) C. It is executed only when an exception occurs.
(d) D. It is used to define custom exceptions.

13. What is the purpose of the continue statement?


(a) Terminates the loop
(b) Skips the current iteration of a loop and continues with the next iteration
(c) Ends the program execution
(d) Restarts the loop from the beginning

14. Which class in Java is used to write character streams.


(a) FileWriter
(b) BufferedWriter
(c) OutputStreamWriter
(d) FileOutputStream

15. Which of the following statements is used to exit a method in Java?


(a) return
(b) break
(c) continue
(d) exit

16. Which of the following is NOT a relational operator?


(a) ==
(b) <>
(c) >=
(d) !=

17. Which interface in Java represents a collection of key-value pairs, where each key is
associated with at most one value?
(a) List
(b) Set
(c) Map
(d) Queue

18. What is the primary goal of object-oriented programming (OOP)?


(a) Code optimization
(b) Procedural decomposition
(c) Data encapsulation and abstraction
(d) Code obfuscation

19. Which method is used to close a file or stream in Java?


(a) closeStream()
(b) endStream()
(c) shutdown()
(d) close()

20. What is the purpose of a getter method in a JavaBean?


(a) To modify the value of a property
(b) To access the value of a property
(c) To instantiate a new object
(d) To delete a property

21. What does the InputStream class represent in Java?


(a) A stream used for reading bytes
(b) A stream used for reading characters
(c) A stream used for writing bytes
(d) A stream used for writing characters

22. What is the difference between Thread.sleep() and Object.wait() in Java?


(a) Thread.sleep() pauses the execution of the current thread, while Object.wait()
releases the lock and waits for notification.
(b) Thread.sleep() releases the lock and waits for notification, while Object.wait()
pauses the execution of the current thread.
(c) Both methods perform the same function.
(d) Neither method is used for thread synchronization.

23. Which loop is guaranteed to execute at least once?


(a) for loop
(b) while loop
(c) do-while loop
(d) if-else loop

24. What is the purpose of the switch statement in Java?


(a) To declare variables
(b) To execute a block of code repeatedly
(c) To select one of many code blocks to be executed
(d) To perform arithmetic operations

25. Which annotation is used to mark a Java class as a JavaBean?


(a) @Bean
(b) @Component
(c) @Entity
(d) @ManagedBean

26. Which method in the File class is used to check if a file or directory exists?
(a) exists()
(b) isExist()
(c) checkExistence()
(d) isFileExist()

27. What is the purpose of the RandomAccessFile class in Java?


(a) To read only the first portion of a file
(b) To access a file randomly without reading from the beginning
(c) To write only to the end of a file
(d) To write to a file randomly without a sequence

28. Which of the following is not a type of program control structure in Java?
(a) Sequence
(b) Iteration
(c) Decision
(d) Inheritance

29. What is the purpose of the FileInputStream class in Java?


(a) To read characters from a file
(b) To read bytes from a file
(c) To write characters to a file
(d) To write bytes to a file

30. Which OOP principle promotes code reusability by allowing a class to inherit
properties and behavior from another class?
(a) Polymorphism
(b) Encapsulation
(c) Abstraction
(d) Inheritance

SECTION B
Comprehensive Answer Questions
Attempt any five (5) questions out of eight (8) questions [5×6=30]

1. Discuss the importance of exception handling in software development. How can


well-designed exception handling contribute to the robustness and reliability of a
software system
2. Analyze the differences between character-based and byte-based I/O streams in Java.
Under what circumstances would you choose one type of stream over the other, and
what are the implications for performance and data manipulation?
3. Discuss the advantages of using object-oriented programming paradigms compared to
procedural programming. Provide examples to illustrate how OOP principles such as
encapsulation, inheritance, and polymorphism contribute to code maintainability and
reusability.
4. Discuss the concept of reflection in Java. How is reflection used to access and
manipulate class information at runtime?
5. Describe the lifecycle of a thread in Java, including its various states and transitions.
6. What are the purposes of program controls? Briefly describe the loop controls.
7. Discuss the significance of using bound and constrained properties in JavaBeans, and
how they contribute to the functionality of the beans.

8. Write short notes on (any two):


a) FileWriter
b) Thread Safety
c) Boxing and Unboxing
d) Abstraction
SECTION C
Long Answer Questions
Attempt any two questions (Question number 3 is compulsory.) [2×20=40]

1. Analyze the principles of encapsulation and abstraction in the context of OOP. How
do these principles promote modularity, information hiding, and code extensibility?
Provide examples of how encapsulation and abstraction are implemented in Java or
another object-oriented language.

2. Discuss the role of buffering in I/O operations and its impact on performance. How
does buffering improve the efficiency of reading and writing data, and what are the
trade-offs associated with using larger or smaller buffer sizes?

3. Suppose you are tasked with developing a Java-based application to support a


graduate-level research project in your field of study. The application needs to
demonstrate proficiency in both basic and advanced features of Java programming.
Analyze the following aspects of the project:

Features:
a. Address the importance of proper code organization and structure in
facilitating code readability, maintainability, and scalability.
b. object-oriented programming (OOP) principles such as encapsulation,
inheritance, and polymorphism can be applied to design robust and extensible
software architecture.
c. use of control structures such as loops, conditional statements, and exception
handling to ensure proper flow control and error management within the
application.
d. Analyze the advantages of using multithreading and concurrency in Java to
improve application performance and responsiveness, especially in scenarios
involving parallel processing or asynchronous tasks.

Based on your analysis, propose a comprehensive plan for developing the Java-based
application, outlining key milestones, development tasks, and quality assurance
measures. Discuss potential challenges and risks associated with the project and
propose strategies for mitigating them. Finally, reflect on how the application aligns
with the goals and objectives of the graduate study courses and how it contributes to
your academic and professional growth in the field

****BEST OF LUCK****

You might also like