0% found this document useful (0 votes)
4 views1 page

Practical File Questions

The document contains a series of Java programming tasks that cover fundamental concepts such as class declaration, input handling, conditional statements, arrays, method overloading, inheritance, method overriding, exception handling, threading, file operations, client-server communication, and GUI components. Each task requires the implementation of specific features and functionalities in Java, demonstrating various programming techniques. The tasks range from basic 'Hello World' outputs to more complex applet and layout management examples.

Uploaded by

yoparov560
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)
4 views1 page

Practical File Questions

The document contains a series of Java programming tasks that cover fundamental concepts such as class declaration, input handling, conditional statements, arrays, method overloading, inheritance, method overriding, exception handling, threading, file operations, client-server communication, and GUI components. Each task requires the implementation of specific features and functionalities in Java, demonstrating various programming techniques. The tasks range from basic 'Hello World' outputs to more complex applet and layout management examples.

Uploaded by

yoparov560
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

Q1: Write a Java program to define and demonstrate the basic structure of a Java program.

The
program should include class declaration, main() method, comments, and output statements to
display “Hello World” and student information(use scanner take input from user ).

Q2: Write a Java program to accept three integer numbers from the user and find the largest number
using conditional (if-else) statements.

Q3: Write a Java program to accept 10 integer values from the user and store them in an array.
Display all the array elements along with their sum and average using loops.

Q4: Write a Java program to define a class Student with data members name and rollNo. Create a
method display() to show student details. Create an object of the class and call the method.
Q5: Write a Java program to demonstrate method overloading by creating a class Calculator with the
following methods:

Q6: Write a Java program to demonstrate single inheritance by creating a class Animal with a method
sound(). Create a subclass Dog that inherits from Animal and calls the inherited method.

Q7: Write a Java program to demonstrate method overriding by creating a class Vehicle with a
method start(). Create a subclass Car that overrides the start() method and displays a different
message.

Q8: Write a Java program to create a superclass Person with a method showDetails(). Create a
subclass Student that overrides the showDetails() method to display student information. Create
objects and demonstrate method overriding.

Q9: Write a java program to demonstrate use of Package create 2 programs containing student
details use protected member method and use in another package.

Q10: Write a Java program to demonstrate handling of Arithmetic Exception using try-catchfinally

Q11: Write a Java program to demonstrate handling of ArrayIndexOutOfBoundsException.

Q12: Write a Java program to create a thread by extending the Thread class.

Q13: Write a Java program to write data into a file using FileWriter and also read the data

Q14: Write a Java program to implement client-server communication using Socket and ServerSocket
classes.

Q15: Write a Java applet that displays the message "Welcome to Java Applet".

Q16: Write a Java applet that contains a button. Display a message when the button is clicked.

Q17: Write a Java program to demonstrate BorderLayout by placing components in NORTH, SOUTH,
EAST, WEST, and CENTER regions.

Q18: Write a Java program to create a calculator-like interface using GridLayout.

You might also like