Category java

Syncronization and Concurrency Utilities

Synchronization When two or more threads need access to a shared resource, they need some way to ensure that the resource will be used by only one thread at a time. The process by which this is achieved is called synchronization.  Thread Communication…

Multithreading and Concurrency

Multithreaded Programming Multithreaded Fundamentals Process vs Thread Thread States The Thread Class and Runnable Interface Java’s multithreading system is built upon the Thread class, its methods, and its companion interface, Runnable. Thread encapsulates a thread of execution. Since you can’t directly refer to the…

Java Database Connectivity (JDBC)

Introduction Purpose of JDBC Components of JDBC Architecture of JDBC Types of JDBC Architecture (2-tier and 3-tier) What is API? JDBC Drivers The JDBC drivers can be downloaded from here Example Note: Make sure to download and add the…

Collection Framework

Introduction Advantages of Collections Arrays One-Dimensional Arrays Multi-Dimensional Array Jagged Array The array created by this program looks like this:  Alternative Array Declaration Syntax Assigning Array References Using the length Member List Interface Set Interface Map Interface Iterator Interface The…

Operators and Expressions

Operators Java provides a rich operator environment. Most of its operators can be divided into the following four groups: arithmetic, bitwise, relational, and logical.  Arithmetic Operators Operator  Result  +  Addition (also unary plus)  –  Subtraction (also unary minus)  *  Multiplication  / …

Variables and Data Types

Variables Declaring Variables In Java, all variables must be declared before they can be used. The basic form of a variable declaration is shown here: type identifier [= value][, identifier [= value]…]; The Scope and Lifetime of Variables Why Data…

Java Basics

The History and Philosophy of Java Object-Oriented Programming Java Development Kit (JDK) The Java Development Kit is an implementation of either one of the Java Platforms; Standard Edition, Enterprise Edition, of Micro Edition platforms released by Oracle Corporation in the…

Lambda Expressions

Lambda expressions was added to Java by JDK 8.  Introducing Lambda Expressions Key to understanding Java’s implementation of lambda expressions are two constructs. The first is the lambda expression, itself. The second is the functional interface. Let’s begin with a simple definition of each.  A lambda expression is,…