SESSION JULY/SEPTEMBER 2025
PROGRAM BACHELOR OF COMPUTER APPLICATIONS
(BCA)
SEMESTER 4
COURSE CODE & NAME DCA2202 & JAVA PROGRAMMING
CREDITS 4
NUMBER OF ASSIGNMENTS & 02
MARKS
30
NAME SHASHANK RAJESH
ROLL NUMBER 2414103457
SET – I
Q1. List any ten Java command tools with a short
description of each. (10 Marks)
Java provides several command-line tools that help developers compile, execute, debug,
document, and manage Java applications. Some important Java command tools are:
1. javac
The Java compiler that converts Java source code (.java files) into bytecode
(.class files) which can be executed by the JVM.
2. java
Used to launch and run Java applications. It executes the bytecode generated by the
compiler.
3. javadoc
Generates API documentation in HTML format from Java source code comments
written using special tags.
4. jar
Used to create, view, extract, or update Java Archive (JAR) files, which bundle
multiple class files and resources.
5. javap
A class file disassembler that displays information about compiled class files,
including methods and fields.
6. jdb
The Java debugger tool that helps developers find and fix bugs by inspecting
program execution.
7. jshell
An interactive Java shell that allows users to execute Java statements without
creating a full program.
8. jps
Lists all running Java processes along with their process IDs.
9. jstat
Monitors JVM performance statistics such as memory usage and garbage collection.
10.keytool
Used to manage cryptographic keys and certificates, mainly for security-related Java
applications.
Q2. Write a Java program to convert Rupees to Dollars.
(10 Marks)
Below is a simple Java program that converts Indian Rupees into US Dollars using a fixed
conversion rate.
import [Link];
public class RupeesToDollars {
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("Enter amount in Rupees: ");
double rupees = [Link]();
// Conversion rate (example)
double rate = 83.0;
double dollars = rupees / rate;
[Link]("Amount in Dollars: $" + dollars);
[Link]();
}
}
Explanation:
The program uses the Scanner class to accept user input. The rupees amount is divided by
the conversion rate to obtain the equivalent amount in dollars. The result is displayed on the
console.
Q3. What are the different methods under
DataInputStream and DataOutputStream? (10 Marks)
DataInputStream and DataOutputStream are used to read and write primitive data
types in a machine-independent manner.
Methods of DataInputStream
● readInt() – Reads an integer value
● readFloat() – Reads a float value
● readDouble() – Reads a double value
● readBoolean() – Reads a boolean value
● readChar() – Reads a character
● readUTF() – Reads a string in UTF format
● readByte() – Reads a byte
● readShort() – Reads a short value
● readLong() – Reads a long value
● readFully(byte[]) – Reads bytes into an array
Methods of DataOutputStream
● writeInt(int) – Writes an integer
● writeFloat(float) – Writes a float value
● writeDouble(double) – Writes a double value
● writeBoolean(boolean) – Writes a boolean value
● writeChar(int) – Writes a character
● writeUTF(String) – Writes a string in UTF format
● writeByte(int) – Writes a byte
● writeShort(int) – Writes a short value
● writeLong(long) – Writes a long value
These streams are commonly used for file handling and network communication.
SET – II
Q4. What is the difference between manual and
automated testing? (10 Marks)
Manual testing and automated testing are two fundamental software testing approaches.
Manual Testing:
Manual testing is performed by testers without using automation tools. Testers manually
execute test cases, observe behavior, and report defects. It is suitable for exploratory
testing, usability testing, and small projects. Manual testing is flexible but time-consuming
and prone to human error.
Automated Testing:
Automated testing uses tools and scripts to execute test cases automatically. It is ideal for
regression testing, performance testing, and large-scale applications. Automated testing
increases accuracy, saves time in repetitive tasks, but requires initial investment in tools and
scripting knowledge.
Key Differences:
Manual testing is slower and less reliable for repetitive tasks, whereas automated testing is
fast and consistent. Manual testing requires human effort each time, while automated tests
can be reused multiple times.
Q5. Explain the purpose and functionality of the JList
component in Java Swing. How does it differ from other
list-type components? (5 + 5 Marks)
Purpose and Functionality of JList
JList is a Swing component used to display a list of items from which the user can select
one or more elements. It supports single selection, multiple selection, and scrolling. JList
uses a ListModel to manage data and provides flexibility in handling large datasets.
Difference from Other List-Type Components
Unlike Choice or ComboBox, JList displays all items at once and allows multiple selections.
ComboBox saves space by using a dropdown, whereas JList is suitable when visibility of all
items is required. JList also supports custom rendering, making it more flexible.
Q6. Differentiate between ArrayList and LinkedList.
Provide suitable examples where each is preferred. (5 +
5 Marks)
Difference between ArrayList and LinkedList
● ArrayList uses a dynamic array internally.
● LinkedList uses a doubly linked list structure.
● ArrayList provides faster access (get()).
● LinkedList provides faster insertion and deletion.
● ArrayList consumes less memory compared to LinkedList.
Examples
● ArrayList Preferred:
When frequent data retrieval is required, such as storing student records accessed
by index.
● LinkedList Preferred:
When frequent insertion and deletion are needed, such as implementing queues or
stacks.