Skip to content

aminarajakumar/Java-Programming-Exercises--2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java-Programming-Exercises-2

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.


📚 Topics Covered

  • Arrays
  • Multidimensional Arrays
  • Jagged Arrays
  • String Handling
  • StringBuffer
  • Constructors
  • this Keyword
  • super Keyword
  • Inheritance
  • Object-Oriented Programming (OOP)

📂 Exercises

Exercise 1 – Employee Salary Analyzer

  • Store employee salaries in an array
  • Find highest salary
  • Find lowest salary
  • Calculate average salary
  • Count employees earning above average

Exercise 2 – Second Largest Element

  • Find the second largest element in an integer array
  • Handles duplicate values correctly

Exercise 3 – Move All Zeros to End

  • Move all zero values to the end
  • Preserve the order of non-zero elements

Exercise 4 – Student Marks Matrix

  • Create a 3 × 4 marks matrix
  • Calculate total marks
  • Calculate average marks
  • Identify the topper

Exercise 5 – Department-wise Employee Count (Jagged Array)

  • Create a jagged array
  • Display employee count for each department
  • Calculate total employees

Exercise 6 – Company Email Validator

  • Validate company email addresses
  • Check if the email ends with @company.com

Exercise 7 – Resume Word Counter

  • Count the number of words in a resume summary

Exercise 8 – Mobile Number Masking

  • Mask the first six digits using StringBuffer

Example:

9876543210
******
3210

Output:

******3210

Exercise 9 – Employee Class Using this Keyword

  • Parameterized constructor
  • Initialize instance variables using this
  • Display employee details

Exercise 10 – Inheritance Using super Keyword

  • Parent class: Person
  • Child class: Employee
  • Initialize parent variables using super
  • Display complete employee information

📁 Project Structure

src/
│
├── exercise1/
├── exercise2/
├── exercise3/
├── exercise4/
├── exercise5/
├── exercise6/
├── exercise7/
├── exercise8/
├── exercise9/
└── exercise10/

🛠 Technologies Used

  • Java
  • Eclipse IDE
  • JDK 17 (or above)

🎯 Learning Outcomes

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

About

A collection of Java Day 2 practice exercises covering Arrays, Matrices, Jagged Arrays, Strings, StringBuffer, Constructors, Inheritance, and Object-Oriented Programming concepts.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages