[Go to site: main page, start]

0% found this document useful (0 votes)
2 views3 pages

Java Programs

The document outlines a series of programming experiments focused on various fundamental concepts in Java, including data types, variables, operators, arrays, control structures, classes, constructors, inheritance, exception handling, string operations, database handling, network programming, applets, Swing, layout managers, and animation. Each experiment includes specific tasks such as creating classes, handling exceptions, manipulating strings, and developing graphical user interfaces. The document serves as a comprehensive guide for learning and applying core Java programming techniques.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Java Programs

The document outlines a series of programming experiments focused on various fundamental concepts in Java, including data types, variables, operators, arrays, control structures, classes, constructors, inheritance, exception handling, string operations, database handling, network programming, applets, Swing, layout managers, and animation. Each experiment includes specific tasks such as creating classes, handling exceptions, manipulating strings, and developing graphical user interfaces. The document serves as a comprehensive guide for learning and applying core Java programming techniques.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Experiment 1: Data Types, Variables, Operators, Arrays, Control Structures

Write a program to store and display different types of data such as integer, float, and character
using variables.

Develop a program to perform arithmetic operations like addition, subtraction, multiplication,


and division using operators.

Write a program to store marks of 5 students in an array and display them using a loop.

Develop a program to check whether a number is even or odd using control statements.

Experiment 2: Class and Constructors

Write a program to create a class Student and initialize its data using a constructor.

Develop a program to demonstrate constructor overloading using different parameter lists.

Write a program to initialize object data using both default and parameterized constructors.

Develop a program to show how constructors are used to assign initial values to objects.

Experiment 3: Inheritance and Abstract Class

Write a program to demonstrate inheritance by creating a parent class and a child class.

Develop a program to show method overriding using inheritance.

Write a program using an abstract class and implement its abstract method in a subclass.

Develop a program to show runtime polymorphism using abstract classes.

Experiment 4: Exception Handling with Interface

Write a program to handle division by zero using exception handling.

Develop a program to use try and catch blocks for handling runtime errors.

Write a program to demonstrate the use of the finally block.

Develop a program where an interface method throws an exception and is handled in the
implementation class.

Experiment 5: String Operations

Write a program to find the length of a string and convert it to uppercase and lowercase.

Develop a program to check whether a string is a palindrome or not.


Write a program to count vowels and consonants in a string.

Develop a program to replace characters and extract substrings from a given string.

Experiment 9: Database Handling (JDBC)

Write a program to connect a Java application to a database.

Develop a program to retrieve and display records from a database table.

Write a program to insert data into a database table using Java.

Develop a program to update or delete records from a database.

Experiment 10: Network Programming

Write a program to create a simple server using Java.

Develop a program to establish a connection between client and server.

Write a program to send a message from client to server.

Develop a program to receive and display data from a network connection.

Experiment 11: Applet and Swing

Write a program to create a simple applet that displays a message.

Develop a program to create a GUI using Swing components like JButton and JLabel.

Write a program to accept user input using JTextField and display it.

Develop a program to handle button click events in a Swing application.

Experiment 12: Layout Managers

Write a program to arrange components using FlowLayout.

Develop a program to demonstrate BorderLayout with different regions.

Write a program to display components in a grid format using GridLayout.

Develop a program to compare different layout managers in Java.

Experiment 13: Animation

Write a program to draw a moving shape on the screen.

Develop a program to animate a ball moving horizontally.


Write a program to continuously repaint a graphical object.

Develop a program to create simple animation using Java graphics.

You might also like