JAVA FOR BEGINNERS

A Fast-Paced Introduction to Java

From Concepts to Code

Created by Nitya Narasimhan / @nitya



REFERENCES
Java Programming WikiBook
Thinking In Java 3rd Edition
The Java Tutorials

WHAT IS JAVA

  • A Programming Language (object-oriented)
  • A Development Platform (SDK)
  • A Runtime Environment (JRE)

HISTORY

  • Green Team (consumer devices)
  • Project Oak (embedded devices)
  • Java Platform (web browsers)
  • Mobile (ME), Standard (SE), Enterprise (EE)
  • Current Java SE 7

JAVA GOALS

  • Simple, Object-oriented, Dynamic
  • Architecture neutral, Portable
  • Robust, Secure
  • Distributed, Multithreaded

The JAVA PROGRAM

  • Written using IDE or Text Editor
  • Compiled to Bytecode using the java compiler
  • Packaged to JAR (archive) using the jar tool
  • Executed in JVM (virtual OS) using the java command


WRITE ONCE, RUN ANYWHERE

The Java Virtual Machine

  • Sandbox = safe environment for executing Java code
  • Liaison = converts bytecode to native code for host OS
  • Interpreted = line-by-line conversion, not efficient


The Just In Time Compiler

  • First usage absorbs compilation overheads
  • Subsequent usage shows performance benefits
  • Not all Java code can be optimized this way (e.g., Reflection)


SETUP CHECKLIST

  • Install the Java SDK for your host OS
  • Install an appropriate IDE (we'll use Eclipse)
  • Verify install with simple program


					
					
					

LANGUAGE FUNDAMENTALS

CODING CONVENTIONS

STATEMENTS

CONDITIONAL BLOCKS

LOOPS

BOOLEAN EXPRESSIONS

VARIABLES

PRIMITIVE TYPES

ARITHMETIC EXPRESSIONS

LITERALS

METHODS

STRING

OBJECTS

KEYWORDS

PACKAGES

SCOPE

ARRAYS

MATHEMATICAL FUNCTIONS

LARGE NUMBERS

RANDOM NUMBERS

UNICODE

COMMENTS

CLASSES AND OBJECTS

DEFINING CLASSES

INHERITANCE

INTERFACES

OVERLOADING METHODS, CONSTRUCTORS

OBJECT LIFECYCLE

SCOPE

NESTED CLASSES

GENERICS

COLLECTIONS

COLLECTION

ARRAYLIST

MAP

COMPARING OBJECTS

EXCEPTIONS

THROWING AND CATCHING EXCEPTIONS

CHECKED EXCEPTIONS

UNCHECKED EXCEPTIONS

PREVENTING NULLPOINTEREXCEPTION

STACK TRACE

NESTING (CHAINED) EXCEPTIONS

CONCURRENT PROGRAMMING

THREADS AND RUNNABLES

BASIC SYNCHRONIZATION

CLIENT SERVER PROGRAMMING

REMOTE METHOD INVOCATION

ENTERPRISE JAVA BEAN PROGRAMMING

JINI JAVASPACES PROGRAMMING

ANNOTATIONS

JAVADOC

INTRO TO ANNOTATIONS

CREATING CUSTOM ANNOTATIONS

META-ANNOTATIONS

HELPING THE COMPILER

PREFACE

BASIC I/O

STREAMS

EVENT HANDLING

JAVA BEANS

CANVAS

GRAPHICS

APPLETS

ADVANCED TOPICS

NETWORKING

DATABASES

REFLECTION

LIBRARIES, EXTENSIONS, FRAMEWORKS

3D PROGRAMMING

JAVA NATIVE INTERFACE

INVOKING C

BYTE CODE

RESOURCES