Jawaharlal Nehru Technological University Hyderabad
Jawaharlal Nehru Technological University Hyderabad B.Tech II JAVA PROGRAMMING Previous Question Paper (February - 2024 - R13)
Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.
Part A
Define polymorphism and inheritance.
Answer
Inheritance is a mechanism where one class acquires the properties and behaviors of another class. Polymorphism is the ability of an object or method to take on many forms, typically achieved through method overloading or method overriding.
How to cast types in expression evaluation?
Answer
Type casting is performed using the cast operator (type) placed before the value. Widening conversions (e.g., int to double) happen automatically, while narrowing conversions (e.g., double to int) require an explicit cast, which may result in data loss.
What is an interface and how it differs from a class?
Answer
Sign in to view the complete answer paper.
What is the significance of CLASSPATH variable?
Answer
Sign in to view the complete answer paper.
List out various checked exceptions in Java.
Answer
Sign in to view the complete answer paper.
How to create threads in Java?
Answer
Sign in to view the complete answer paper.
What is the use of Scanner class?
Answer
Sign in to view the complete answer paper.
Contrast text streams and binary streams.
Answer
Sign in to view the complete answer paper.
List the swing containers.
Answer
Sign in to view the complete answer paper.
What are the various events generated by menu, List box components?
Answer
Sign in to view the complete answer paper.
Part B
Compare and contrast procedure oriented programming with object oriented programming. Which paradigm is preferred for advanced problem solving? Why.
Answer
Sign in to view the complete answer paper.
What is method overloading? Demonstrate with sample Java code.
Answer
Sign in to view the complete answer paper.
Write a Java program to check whether a given string is palindrome.
Answer
Sign in to view the complete answer paper.
Write a program to explain the concept of dynamic method dispatch and also discuss real world applications of this concept.
Answer
Sign in to view the complete answer paper.
What is a nested class? Is every nested class an inner class? Justify your answer.
Answer
Sign in to view the complete answer paper.
Explain the member access rules for package in Java
Answer
Sign in to view the complete answer paper.
Explain the benefits of exception handling.
Answer
Sign in to view the complete answer paper.
Demonstrate creation of user defined exception in Java.
Answer
Sign in to view the complete answer paper.
Describe thread states and thread priorities.
Answer
Sign in to view the complete answer paper.
Write a program to implement producer-consumer communication using inter thread communication functions.
Answer
Sign in to view the complete answer paper.
Write a program to perform find and replace activity on a given file. Read file name as command line argument and string1 to search in the file and replace it with string2. String1 and String2 are from user through prompt.
Answer
Sign in to view the complete answer paper.
Discuss the steps need to be followed in establishing connectivity to a database.
Answer
Sign in to view the complete answer paper.
What is a hash table? Why is it used in programming?
Answer
Sign in to view the complete answer paper.
What is an event? Explain delegation event model with suitable program for handling mouse events.
Answer
Sign in to view the complete answer paper.
Why is an applet more secure than an application program?
Answer
Sign in to view the complete answer paper.
Write a program to create user interface for simple arithmetic calculator using swing components and grid layout manager.
Answer
Sign in to view the complete answer paper.