This repository contains solutions to Day 2 Java programming exercises. These programs are designed to strengthen the understanding of Java fundamentals, including arrays, strings, constructors, inheritance, and object-oriented programming.
- Arrays
- Multidimensional Arrays
- Jagged Arrays
- String Handling
- StringBuffer
- Constructors
- this Keyword
- super Keyword
- Inheritance
- Object-Oriented Programming (OOP)
- Store employee salaries in an array
- Find highest salary
- Find lowest salary
- Calculate average salary
- Count employees earning above average
- Find the second largest element in an integer array
- Handles duplicate values correctly
- Move all zero values to the end
- Preserve the order of non-zero elements
- Create a 3 × 4 marks matrix
- Calculate total marks
- Calculate average marks
- Identify the topper
- Create a jagged array
- Display employee count for each department
- Calculate total employees
- Validate company email addresses
- Check if the email ends with @company.com
- Count the number of words in a resume summary
- Mask the first six digits using StringBuffer
Example:
9876543210
******
3210
Output:
******3210
- Parameterized constructor
- Initialize instance variables using this
- Display employee details
- Parent class: Person
- Child class: Employee
- Initialize parent variables using super
- Display complete employee information
src/
│
├── exercise1/
├── exercise2/
├── exercise3/
├── exercise4/
├── exercise5/
├── exercise6/
├── exercise7/
├── exercise8/
├── exercise9/
└── exercise10/
- Java
- Eclipse IDE
- JDK 17 (or above)
By completing these exercises, you will gain hands-on experience with:
- Array manipulation
- Matrix operations
- Jagged arrays
- String processing
- StringBuffer methods
- Constructors
- this keyword
- super keyword
- Inheritance
- Object-Oriented Programming