Skip to content

priya05-git/JAVA-PROGRAMS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Programs Collection

Welcome to the Java Programs repository! This project serves as a comprehensive collection of fundamental and intermediate Java concepts. It contains neatly categorized examples ranging from basic syntax up to object-oriented programming (OOP) principles.

This repository is perfect for beginners who want to refresh their knowledge of Java or step into programming with practical, easy-to-understand examples.


📂 Project Structure

This repository is organized into specific directories, each focusing on a fundamental Java topic:

1. Basics

Contains beginner-friendly introductory programs to understand the fundamentals of Java syntax, data types, and simple class design.

  • Programs include calculating the area of simple shapes (area.java), swapping variables (swap.java), simple summation (sum.java), and intro to class structures (Student.class, intro.java).

2. Array

Contains programs demonstrating arrays in Java.

  • Includes concepts like reversing an array (ReverseArray.java), finding odd numbers (OddArray.java), and basic array manipulation.

3. Loops

Focuses on iterative/looping constructs in Java (for, while, do-while).

  • Great logic-building examples like finding the HCF/LCM of numbers (hcf_lcm.java), checking for Palindromes (Palindrome.java), counting occurrences (Count.java), and a simple Calculator (Calculator.java).

4. Inheritance

Demonstrates basic Object-Oriented Programming (OOP) concepts related to Inheritance.

  • Includes class relationship examples showing how child classes inherit properties and methods from parent classes (inheritance.java).

5. Polymorphism(Method Overloading)

Shows polymorphism principles, specifically method overloading. Note that there are also several good logic programs integrated here showing overloaded use cases.

  • Examples include prime checking (Prime.java, primerange.java), overloaded sum of 2 numbers (sumof2nos.java), and more dynamic logic structures.

6. Interface

Demonstrates the use of Interfaces in Java for achieving abstraction and multiple inheritance.

  • Features a comprehensive BankingSystem.java and interface1.java demonstrating how classes implement interfaces to define specific behaviors.

7. String

Focuses on String classes and their manipulation.

  • Includes string-driven logical classes like Bank.java and other practical string operations (prg15.java, prg16.java).

🚀 How to Run the Programs

All source code files are written in standard Java (.java files).

  1. Clone the repository:
    git clone <repository-url>
  2. Navigate into a specific folder, for instance, Strings:
    cd "JAVA PROGRAMS"/String
  3. Compile the Java file using javac:
    javac Bank.java
    (Note: This creates a .class file in the same directory, which is the compiled bytecode).
  4. Run the compiled Java class using java:
    java Bank

🛠 Prerequisites

To compile and run these programs natively you will need:

  • Java Development Kit (JDK): Make sure JDK is installed on your local machine. You can download it from Oracle or grab an open-source version like Adoptium/Eclipse Temurin.
  • An IDE (like IntelliJ IDEA, Eclipse, or Visual Studio Code) for a better development experience, or you can just run them via the command line / terminal.

Happy Coding! Feel free to explore, modify, and experiment with the code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors