JNTU
JNTU B.Tech IV Year JAVA PROGRAMMING Previous Question Paper (July/August - 2022 - R18)
Answer any five questions. All questions carry equal marks.
Main
List and explain java buzzwords.
Answer
Java buzzwords represent the core design goals that make the language robust and versatile. The key buzzwords include:
- Simple: Java is designed to be easy to learn by removing complex features like explicit pointers and operator overloading found in C++.
- Object-Oriented: Everything in Java is an object, facilitating modularity and code reuse through encapsulation, inheritance, and polymorphism.
- Platform Independent: Java code is compiled into bytecode, which can run on any device equipped with a Java Virtual Machine (JVM), summarized as 'Write Once, Run Anywhere' (WORA).
- Secure: Java provides a secure environment by eliminating pointers, enforcing strict type checking, and using a security manager to control access to system resources.
- Robust: It emphasizes early checking for possible errors, with features like strong memory management and automatic garbage collection.
- Multithreaded: Java supports concurrent execution, allowing multiple tasks to run simultaneously within a single program.
- Distributed: Java is designed for the internet, providing extensive libraries for handling TCP/IP protocols and remote method invocation.
Explain various parameter passing techniques with example.
Answer
Java primarily uses Pass-by-Value for parameter passing. The behavior differs based on the data type:
- Pass-by-Value (Primitive Types): When a primitive type (int, char, etc.) is passed, a copy of the value is created. Changes made to the parameter inside the method do not affect the original variable.
- Pass-by-Reference (Objects): When an object is passed, the value of the reference (the memory address) is copied. While the reference itself is passed by value, the method can modify the internal state of the object because both the original and the copy point to the same memory location.
Example:
class Test { void modify(int i, int[] arr) { i = 10; arr[0] = 10; } }In this example, calling modify(x, array) will leave the original integer x unchanged, but the first element of the array will be updated to 10 because the method operates on the object reference.
Write a java program to multiply two matrices.
Answer
Sign in to view the complete answer paper.
Give an example for constructor overloading.
Answer
Sign in to view the complete answer paper.
Distinguish between classes and interfaces.
Answer
Sign in to view the complete answer paper.
What is package? What are its advantages? Give examples.
Answer
Sign in to view the complete answer paper.
What is an interface? Discuss various issues in extending an interface.
Answer
Sign in to view the complete answer paper.
Discuss various forms of inheritance in Java.
Answer
Sign in to view the complete answer paper.
Distinguish between throw and throws keywords for exception handling.
Answer
Sign in to view the complete answer paper.
Give an overview of string handling functions in Java.
Answer
Sign in to view the complete answer paper.
How can you create your own exception? Explain with an example.
Answer
Sign in to view the complete answer paper.
Write a program to create student registration form with appropriate fields and components.
Answer
Sign in to view the complete answer paper.
Give an overview of event handling in Java.
Answer
Sign in to view the complete answer paper.
What is a thread? How do you assign thread priorities? What is a daemon thread?
Answer
Sign in to view the complete answer paper.