Skip to content

TajwarSaiyeed/programming-with-java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Fundamentals Practice

This repository contains a collection of Java programs that demonstrate fundamental concepts in the Java programming language. It's intended for beginners who are learning Java and want to explore basic syntax, data types, operators, and other core features.

Files Included

  • ArithmeticExpressions.java: Examples demonstrating different arithmetic operations and how to construct arithmetic expressions in Java.
  • Array.java: Shows how to declare, initialize, and manipulate single-dimensional arrays in Java.
  • Casting.java: Illustrates explicit and implicit type casting between different primitive data types.
  • ComparisonOperator.java: Examples of using comparison operators to compare values in Java.
  • Constants.java: Demonstrates how to declare and use constant variables in Java using the final keyword.
  • Escape_Sequences.java: Provides examples of using escape sequences in strings for special characters.
  • FormattingNumbers.java: Explores ways to format numbers (e.g., currency, percentages) for output.
  • IfStatements.java: Examples of using if statements to execute code based on a condition in Java.
  • LogicalOperators.java: Examples of using logical operators to combine multiple conditions in Java.
  • Main.java: This is a basic main method file that contains simple code.
  • MathOperation.java: Illustrates commonly used math functions provided by the Java standard library.
  • MultiDimensionArray.java: Shows how to create and work with multi-dimensional arrays.
  • OrderOfOperations.java: Demonstrates the precedence of operators in Java expressions.
  • Pri_Vs_Ref.java: Compares primitive data types with reference types, specifically focusing on their way of storing data and variable assignation.
  • Primitive_Types.java: Examples of using all of the primitive data types, explaining their ranges, sizes, and default values.
  • ReadInput.java: Shows how to read input from the user using the Scanner class.
  • Reference_Type.java: Explains the core of reference type, such as object initialization and object type variables.
  • Simplifying_IF_Statements.java: Examples of simplifying if statements using logical operators and ternary operators.
  • Strings.java: Examples of how to create, compare, and manipulate Strings using the String class.
  • TernaryOperator.java: Examples of using the ternary operator to write concise conditional expressions in Java.
  • Variable.java: Demonstrates how to declare and use variables with different data types.

How to Use

  1. Clone the repository:
    git clone https://github.com/TajwarSaiyeed/programming-with-java
  2. Navigate to the project directory:
    cd HelloWorld
  3. Compile Java files:
    javac src/*.java
  4. Run the programs:

    To run a program, such as ReadInput.java, execute:

    java src/ReadInput
  5. Quick Testing:

    If you'd like to test a code snippet quickly without setting up a local environment, you can use an online Java compiler such as Online Java Compiler.

About the Code

  • Each file focuses on a specific concept to ensure clarity and easy understanding.
  • Comments are included in each file to explain the code and logic.

Contributing

If you find any errors, or have suggestions for improvements, feel free to submit an issue or pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.