📕
Knowledge
  • Knowledge Repository
  • Java
    • Intro
    • Persistence
      • Java Persistence API (JPA)
        • Entity Manager
        • Transaction Management
        • Relationship Mapping
      • Java Transaction API (JTA)
    • Resources
  • Angular
    • Intro
    • Overview
    • CLI Commands
    • Directives
  • Tools
    • IDEs
      • IntelliJ
        • Shortcuts
  • Book Notes
    • Intro
    • Java A Beginner's Guide
      • Chapter 1. Java Fundamentals
      • Chapter 2. Data Types and Operators
      • Chapter 3. Program Control Statements
      • Chapter 4. Introducing Classes, Objects, and Methods
      • Chapter 5. More Data Types & Operators
      • Chapter 6. Closer Look At Methods and Classes
      • Chapter 7. Inheritance
      • Chapter 8. Packages & Interfaces
      • Chapter 9. Exception Handling
      • Chapter 10. Using I/O
    • Data Pipelines With Airflow
      • Chapter 1. Meet Airflow
      • Chapter 2. Anatomy Of a DAG
  • Course Notes
    • Intro
    • Spring: TDD With JUnit
Powered by GitBook
On this page
  • History & Philosophy
  • Java's Magic: The Bytecode
  • Release Schedule
  • OOP
  • Java Development Kit
  • Java Keywords

Was this helpful?

  1. Book Notes
  2. Java A Beginner's Guide

Chapter 1. Java Fundamentals

"this chapter provides a brief overview of several Java features..."

History & Philosophy

  • Developed by James Gosling, et al, at Sun Microsystems in 1991.

  • Initially called Oak, renamed to Java in 1995.

  • Platform independent language

  • Influenced by C/C++, with similar syntax.

Java's Magic: The Bytecode

To address issues of portability and security that affected other languages, the output of a Java compiler is not directly executable code. Instead it's Bytecode, a set of instructions designed to be executed by the Java Virtual Machine (JVM).

Release Schedule

Since JDK 9, the release schedule for major updates occurs approximately every 6 months. However, a lot of new features are often only experimental at time of release. For commercial development, stick to long term support (LTS) versions Java 8, 11 + others when released.

OOP

Java is an Object Orientated Language and achieves this with three main traits:

  • Encapsulation - Binding code and the data it manipulates, together.

    • A Java class is the basic unit of encapsulation to achieve this.

    • Access modifiers allow classes, and their members to be public or private.

  • Polymorphism - is the quality that allows one interface to access a general class of actions.

    • Polymorphism helps to reduce complexity by allowing the same interface to be used to specify

      general class of actions. This means that it's possible to design a generic interface to a group

      of related methods.

  • Inheritance - The process by which one object can use the properties of another object.

    • Think class Fruit (with properties of sweetness etc), inherits properties from class Food (with properties of nutrition, edible, type etc).

    • Without this mechanism, each individual class would need to explicitly define the same properties each time.

Java Development Kit

JDK is required on the specific machine to be able to compile and run a Java program.

  • There are multiple flavours of the JDK. Oracle and OpenJDK are popular.

  • JDK supplies two main programs; javac which is the compiler and java, which is the standard Java interpreter.

  • The JDK runs in the command-prompt environment only. To compile and run a Java program you can use the command line, however this is typically handled by the IDE now.

Java Keywords

As of Java 11, there are 61 keywords defined in the language. Along with the operators and separators these form the definition of the Java language. The following keywords cannot be used as names for variables, classes or methods.

abstract

assert

boolean

break

byte

case

catch

char

class

const

continue

default

do

double

else

enum

exports

extends

final

finally

float

for

goto

if

implements

import

instanceof

int

interface

long

module

native

new

open

opens

package

private

protected

provides

public

requires

return

short

static

strictfp

super

switch

synchronized

this

throw

throws

to

transient

transitive

try

uses

void

volatile

while

with

PreviousJava A Beginner's GuideNextChapter 2. Data Types and Operators

Last updated 4 years ago

Was this helpful?