StudyLover
  • Home
  • Study Zone
  • Features
    • Workout Interval Timer
    • Typing Tutor
  • Profiles
  • Contact us
  • Sign in
StudyLover Java Programs
Download
  1. Java
Syllabus
Java
  • Unit 1: Introduction to Java and Core OOP Concepts
  • Unit 2: Advanced OOP, Inheritance, and Polymorphism
  • Unit 3: Packages, Exception Handling, and Multithreading
  • Unit 4: GUI Programming, Applets, and Events
  • Unit 5: Collections, I/O Streams, JDBC, and Reflection
  • Unit 6: Web Tier Development: Servlets and JSP
  • Unit 7: Enterprise Frameworks: Struts and Spring
  • Unit 8: Data Persistence, Mail API, and Design Patterns
  • Unit 9: Mobile Application Development with Android
  • Programs

1.   The System Architect: Create a program that prints the Java version and installation directory. Demonstrate "Narrowing Type Casting" by converting a double to an int and explain the data loss in comments.

2.   The Decision Hub: Build a "Discount Calculator" that uses if-else for price ranges and a switch-case to apply different discounts based on a "Membership Level" (Bronze, Silver, Gold).

3.   The Loop Mechanic: Write a program that uses a for loop to print a multiplication table and a while loop to reverse the digits of a user-provided number.

4.   The Student Blueprint: Create a Student class with attributes (name, age). Include a default constructor and a parameterized constructor. Demonstrate the order of execution using an Anonymous Block.

5.   The 'this' & Memory Tracker: Use the this keyword to distinguish between instance variables and local parameters in a setter method. Add a static variable to count how many student objects have been created.

6.   The Inheritance Chain: Create an Employee base class and a Manager subclass. Use the super keyword to invoke the parent constructor and override a work() method to show specialized behavior.

7.   The Polymorphism Lab: Create a Shape class with a calculateArea() method. Override it in Circle and Rectangle. Use a Shape reference variable to call methods of child objects (Dynamic Method Dispatch).

8.   The Abstract & Final Contract: Design an abstract class Payment with an abstract method processPayment(). Implement this in CashPayment and CardPayment classes.

9.   The Interface Agreement: Define an interface RemoteControl. Implement it in TV and AirConditioner classes to demonstrate how unrelated classes can share the same "Role."

10.                     The String Performance Lab: Compare the efficiency of String and StringBuffer. Write a program that appends "Hello" to a string 5,000 times in a loop and prints the time taken for each.

11.                     The Basic Window (Swing): Use Java Swing to create a simple JFrame with a JLabel (title), a JTextField (input), and a JButton (submit).

12.                     The Layout Organizer: Create a "Profile Form" using GridLayout or BorderLayout to neatly align labels and text fields for Name, Email, and Phone.

13.                     The Event Responder: Implement an ActionListener so that when a button is clicked, the text entered in a JTextField is displayed in a message dialog or a second label.

14.                     The Interaction Tracker: Use MouseListener to change the background color of a panel whenever the mouse enters or clicks the area.

15.                     The ArrayList Manager: Create an ArrayList of employee names. Implement a menu to: Add a name, Remove a name, and Sort the list alphabetically using Collections.sort().

16.                     The Unique Identity Set: Use a HashSet to store a list of product IDs. Demonstrate how the set automatically rejects duplicate IDs entered by the user.

17.                     The Phonebook Map: Use a HashMap to store Names (Keys) and Phone Numbers (Values). Allow the user to input a name to retrieve the corresponding number.

18.                     The JDBC Connector: Write a script to establish a connection to a database (MySQL/PostgreSQL) and print "Connected Successfully" using the DriverManager.

19.                     The SQL Executor: Use a PreparedStatement to insert user data into a "Users" table and a ResultSet to fetch and display all records in the console.

20.                     The Hello Servlet: Create an HttpServlet that takes a name from an HTML form and displays a "Welcome to Java Web Tier" message back to the user's browser.

 

Syllabus
Our Products & Services
  • Home
Connect with us
  • Contact us
  • info.studylover@gmail.com

StudyLover - About us

The Best knowledge for Best people.

Copyright © StudyLover
Powered by Odoo - Create a free website