Pamirus / java-tutorial

This repository includes my Java introductory training works.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java-tutorial

This repository includes my Java introductory training works.

I followed the program path Java ile Programlamaya Giriş course by Engin Demiroğ in BTK Akademi.


Introduction to Java:

  1. helloWorld
  2. variables
  3. dataTypes
  4. conditionalStatements
  5. conditionalStatementsDemo
  6. switchStatements
  7. forLoops
  8. whileLoops
  9. doWhileLoops
  10. arrays
  11. arraysDemo
  12. multiDimensionalArrays
  13. strings

Mini-Projects in Java:

  1. primeNumber
  2. lowOrThinVowelChar
  3. perfectNumber
  4. friendNumbers
  5. findNumber

Object Oriented Programming in Java:

  1. methods
    1. Methods
    2. MethodsVariableArguments
  2. class
    • Classes define the blueprints for objects (instances). A class is a structure that contains properties (fields) and behaviors (methods).
  3. classDemo
  4. classesWithAttributes
  5. encapsulation
    • Encapsulation involves grouping the data and methods that manipulate the data within a single unit. Encapsulation restricts the access to certain components, enhancing security and maintainability.
  6. constructors
    • Constructors are methods which are called when an object is created. The constructors are usually used to initialise the fields of a class or perform some initial operations.
  7. methodOverloading
  8. inheritance
    • The inheritance allows a class to inherit properties and behaviours from another class, promotes the reusability of code.
  9. inheritanceDemo
  10. polymorphism
    • There are two types of polymorphism in OOP. Compile-time and run-time polymorphism.

      Compile-time polymorphism is overloading, which is made with the same-named method, but has a different parameter list. Return type conversion cannot be done with the same parameter list since the signature of the methods will be the same due to the same parameter list.

      The return type cannot be changed with the same parameter list by overloading. Because the signatures of the methods would be exactly the same with the same parameter list.

      Run-time polymorphism is overriding, which is made with the same-named base class method in the derived class. The overridden method has the same parameter list. However, it allows us to make different operations.

  11. overriding
  12. abstractClasses
    • Abstract classes cannot be instantiated on their own.

      Abstract classes may contain abstract methods. Subclasses that extend an abstract class must provide implementations for all the abstract methods or be declared as abstract classes themselves.

      Abstract classes are often used to define a common interface or behavior that multiple subclasses share. They provide a way to partially implement a class and leave some methods for the subclasses to implement based on their specific needs.

  13. abstractClassesDemo
  14. interfaces
    • Interfaces define a contract that a class must implement, specifying which methods should be included. Multiple implementation of the interfaces in one class is allowed.
  15. polymorphismWithInterfaces
  16. interfaceDemo
  17. composition
    • The static keyword is used to define class-level entities that are shared among all instances of the class. Static members can be called over the class directly, so the object is not necessary to call a static member. The static keyword is often used for the utility elements.

      The inner classes are used to organize code, enhance encapsulation, and logically group related classes together. However, the inner classes are not often used to prevent the violation of the single responsibility principle.

Packages

Packages are used to organize and structure classes and interfaces into different namespaces. It helps avoid naming conflicts and provides a hierarchical structure to the code. Packages also aid in creating modular and reusable code.

  1. packagesDemo
  2. packageCreation

Collections

Collections refer to frameworks or interfaces that are used to store and manipulate groups of objects. They provide a way to work with groups of objects as a single unit.

  1. arrayList
  2. typesafeArrayList
  3. arrayListWithClasses
  4. hashMap

Exception Handling

Exception handling refers to the mechanism that allows you to handle runtime errors or exceptional conditions that may occur during the execution of a program.

  1. exceptionHandling
  2. readFileDemo
  3. throwDemo
  4. customException

File Operations

File operations refer to performing various tasks related to handling files and directories using classes and methods provided by the Java I/O (Input/Output) API. These operations include tasks like reading from files, writing to files, creating directories, deleting files, checking file existence, and more.

  1. workingWithFiles
  2. readFiles
  3. writeFiles

Generics

Generics are used to create classes, interfaces, and methods that can work with any data type. They provide a way to make the code more flexible, reusable, and type-safe by allowing you to write classes and methods that can operate on a variety of data types without sacrificing type safety.

  1. generics
  2. genericsDemo
  3. genericMethods

Threading

Threading refers to the concurrent execution of two or more parts of a program, allowing tasks to run in parallel. Threads are the smallest unit of execution within a process and enable programs to perform multiple tasks simultaneously.

  1. threadingDemo

Database Programming with JDBC

The Java Database Connectivity (JDBC) concept is an important aspect of Java programming to work with databases in Java applications.

NOTE: The database connection with JDBC needs a JDBC driver. Thus, the driver was added to the "libs/" folder. The compile command may be used as follows.

cmd /c 'javac Main.java && java -cp ".;../lib/mysql-connector-j-8.0.33.jar" Main'

  1. selectDemo
  2. insertDemo
  3. updateDemo
  4. deleteDemo

Programming GUI with Swing

  1. swingDemo

    Screenshots:

    Initial State

    Click on Test

    Click on Reset

  2. jListDemo

    Screenshots:

    Initial State

    Add Student

    Remove Student

    Remove Selected

  3. sqlDemo

    Screenshots:

    Initial State

  4. tableRowSorted

    Screenshots:

    Initial State

    Search State

  5. addData

    Screenshots:

    Initial State

    Add New Data


Final Test Final Test Result

About

This repository includes my Java introductory training works.


Languages

Language:Java 100.0%