Animals Information System is an interactive console application built with Java that provides detailed information about various animals and allows users to play their sounds. The project demonstrates object-oriented programming principles, working with data collections (HashMap), audio file processing, and interactive console input.
The application supports information about 6 different animals: dog, cat, monkey, horse, anteater, and leopard. Each animal includes scientific name, classification, lifespan data, habitat range, diet type, weight, and maximum speed.
- 🎯 Interactive Animal Selection — choose an animal by entering the first letter of its name
- 📊 Detailed Information — display comprehensive data about the selected animal
- 🔊 Sound Playback — optional playback of animal sound files
- 🎨 Console Interface — user-friendly and intuitive command-line interface
- ✅ Input Validation — validation of user input for correctness
- Java — primary programming language
- OOP Concepts:
- Classes and Objects
- Encapsulation
- Nested Classes
- Java Collections Framework — HashMap for storing animal data
- Java Sound API — for audio file playback
- Scanner — for handling user input
Animals/
│
├── src/
│ ├── Main.java # Main application class
│ │ ├── main() # Application entry point
│ │ ├── class Animal # Nested class for animal operations
│ │ │ ├── displayInfo() # Method to display information
│ │ │ └── makeSound() # Method to play sound
│ │ └── class SoundPlayer # Nested class for audio operations
│ │ └── playSound() # Static method for audio playback
│ │
│ └── sounds/ # Directory containing sound files
│ ├── cat.wav
│ ├── dog.wav
│ ├── monkey.wav
│ ├── horse.wav
│ ├── anteater.wav
│ └── leopard.wav
│
├── out/ # Compiled classes
│ └── production/
│ └── Animals/
│
├── Animals.iml # IntelliJ IDEA module configuration
└── README.md # Project documentation
-----Info about animals-----
Available animals list:
Dog
Cat
Monkey
Horse
Anteater
Leopard
Enter the first letter of the animal you wish to select:
c
The selected animal is: Cat
scientific_name: Felis catus
family: Mammalia / Felidae
lifespan: 12–18 years
range: Domestic
feeding: Carnivore
ave_weight: 3.5–5 kg
top_speed: Up to 48 km/h
Do you want to play the animal sound? [y/n]
y
Cat says:
[Cat meowing sound plays 🐱]-----Info about animals-----
Available animals list:
Dog
Cat
Monkey
Horse
Anteater
Leopard
Enter the first letter of the animal you wish to select:
l
The selected animal is: Leopard
scientific_name: Panthera pardus
family: Mammalia / Felidae
lifespan: 12–17 years (in the wild)
range: Africa and Asia (from rainforests to deserts)
feeding: Carnivore
ave_weight: 30–90 kg
top_speed: Up to 58 km/h
Do you want to play the animal sound? [y/n]
nThis project demonstrates the following Java concepts:
- ✅ Creating and using classes
- ✅ Nested static classes
- ✅ Working with HashMap for storing structured data
- ✅ Processing user input via Scanner
- ✅ Working with audio files via Java Sound API
- ✅ Exception handling
- ✅ Interactive console application
This project was created for educational purposes to learn object-oriented programming in Java.