Learn Basics of Core Java in 49 Lessons

We have covered substantial ground in the last 49 lessons. These lessons are sufficient for learning basics of core Java even for beginners. Of course, we have not yet covered all the topics that a Java programmer must know. We will resume our onward journey from lesson #51 where we start covering topics such as collections, threads, annotations and generics. But before proceeding we will recap what we have covered to take maximum advantage of previous lessons.

Note that lessons on http://codingraptor.com are sequentially arranged. So, you can start from the first lesson and follow the next links the same way you would read a book.

Beginning Java from Scratch

If you are total newbie with no previous experience in programming and no previous exposure to Java, you should study the following lessons and preferably in order they are presented. If you are an experienced programmer coming from another language, you need to pay extra attention to setting up the environment part because Java’ s development environment has a very different requirements from other languages such as JavaScript.

  1. Beginning Java: History in Brief – The let there be light lesson. Explains history of Java. How Java became so popular. Why it is so easy to pick up Java and how anyone can learn Java.
  2. Features of Java and Buzzwords –  Introduces you to distinguishing features of Java and the most frequently used jargon of the Java world. Sun Microsystems coined 11 buzzwords in a whitepaper and these 11 words have become the corner stone of Java’s marketing strategy.
  3. JVM, JRE, JDK and JIT – newbies may get overwhelmed by these three letter acronyms. But having a firm understanding of these four pillars of Java’s contained programming environment is essential.
  4. Inside JVM 101 – JVM is a complicated C/C++ program and uses a number of complicated data structures. This lesson describes the basics of JVM architecture and the different memory areas in Java. Knowing about the memory areas plays a crucial role in writing concurrent programs.
  5. Java’s Program Execution Model and WORA – Java is famous for its write once run anywhere paradigm. This lesson explains how Java program gets compiled and executed. The lesson explains how Java’s compilation and execution makes WORA possible.

Setting up Your Environment and Running Hello World!

Having looked at what Java is and how it compiles and runs, we next turn to setting up our development environment and running the most basic Java program –

  1. Set up your programming environment – describes how to install JDK, the enviroment variables that might be useful and how to avoid “It works on my machine” kind of bugs.
  2. Using Netbeans – describes the basics of Netbeans IDE for Java development
  3. Using Eclipse – describes the basics of Eclipse IDE for Java development
  4. Using Text Editors – Many a times you want to avoid the overhead of a bloated IDE. Plain programming editors can work great if you know how to harness their power.
  5. Write and Run Hello World! – understand what main method is and what it does. Run the most basic Java program
  6. Learn to run Java programs from command line – many Java ‘experts’ don’t know how to set classpath and run Java programs from a command line. Learn how to run Java programs from command lines such as Linux terminal, Windows Power Shell and Mac’s terminal.

Learn About Variables and Data Types

Variables are the essential building blocks of a program in almost every language. Java is no exception. Data types take a special significance because Java is a strongly typed language.

  1. Variables in Java – learn how to declare and use variables. This lesson teaches about the four types of variables in Java. These four types have different lifetimes and visibility and knowing about the liveliness of a variable is essential to accessing them properly.
  2. Primitive Data Types in Java – though Java is strictly object oriented, a few data types are not objects. These data types are some of the most essential data types and are used for representing things as basic as characters and numbers.
  3. Literals in Java – Literals are one of the under-rated features of core Java.  Knowledge of literals is especially essential for understand Java strings.
  4. Reference Data Types – are all too common in Java. Knowing about reference data types is essential to understand the control flow of even simplest Java program.

Operators and Statements in Core Java

Operators, conditional statements and looping constructs form the backbone of any program. Java is no different in this regard. Java has fearlessly adapted and incorporated successful operators and conditional statements (such as the enhanced for loop) from other languages from time to time. Introducing a new looping construct in a mature programming language such as Java is a bold step and the richness of Java statements can be attributed to this audacity.

  1. Conditional Statements – decision making structures of Java. Must know even for writing most basic programs.
  2. Operators – allow you to manipulate data. Bread and butter of every program.
  3. Statements, expressions and code blocks – even a lot of experienced programmers are oblivious to power of code blocks and can’t differentiate between an expression and a statement. An understanding of statements, expressions and code blocks is essential to derive the lifespan of variables.
  4. while, do-while looping constructs – although not the most popular looping construct, while statement allows for looping in indeterminate situations. It is essential to know when and how to use the while and do-while loops.
  5. The for loop – a for loop is the most popular looping mechanism. Learn how to use for loop and its read-only variant.

 Modifiers in Java

Java allows a range of access and non-access modifiers. The modifiers alter the meaning, lifespan, visibility or value of a variable. The following is comprehensive list of tutorials on modifiers in Java –

  1. Access modifiers in Java – learn about the four access modifiers, how to use them and their impact on visibility of variables
  2. Non Access Modifiers: static and strictfp – learn about the most popular non access modifier i.e. static and the most exotic non access modifier i.e. strictfp
  3. Non Access Modifiers: final and synchronized – learn about final means in Java and how to use synchronized in multithreaded programs.
  4. Non Access Modifiers: abstract, transient, native and volatile –  learn about the rest of non access modifiers in Java

Packages and import Statement

Java uses packages both for runtime security and avoiding name clashes. The import statement is the enabler which makes packages work seamlessly.

  1. Packages – learn more about packages in Java
  2. The import statement
  3. Static import in Java

Passing Inputs to Java Programs

No program is an island! You invariably have to pass in inputs to it – either through file or through command line or through environment variables.

  1. Passing inputs to Java programs via command line
  2. Passing inputs to Java programs via environment variables and files

Arrays in Java: Most Discussed, Least Used

Arrays in Java are not particularly popular. The fixed size of the data structure coupled with availability of linked lists such as Vectors right from version 1.0 has lead to arrays falling out of favour. Nevertheless, arrays are a must know data structure.

  1. What is an array?
  2. Declaring, initializing and instantiating an array
  3. Multidimensional arrays in Java
  4. Manipulating individual elements of an array
  5. Iterating arrays

Strings in Java

String manipulation is pretty easy on the surface. But Java strings are special. Except for Java string no other data type has an operator overloaded for it. Further, there are two ways of declaring strings and string literals can be used as string objects. Given the popularity of Java strings and myriad of complications, we spend fair deal of time discussing strings –

  1. Introduction to Java Strings
  2. String Immutability in Java
  3. StringBuilder and StringBuffer
  4. Some noteworthy methods in String class
  5. The intern method
  6. Miscellaneous  String methods

Exceptions in Java

Exceptions are Java’s object oriented constructs to represent unusual situations. Almost every serious Java program deals with exceptions. Therefore, it is essential to learn the types of exceptions, how to use them and what types of exceptions should you create and throw –

  1. An Introduction to Java Exceptions (and some humor ?
  2. Introducing try, catch and finally
  3. Control flow in nested try, catch and finally
  4. A recap of rules concerning exceptions
  5. try with resource
  6. Class hierarchy of exceptions
  7. The throw and throws keywords
  8. Creating custom exceptions

Varargs in Java

Varargs or variable arguments is a feature that was introduced in Java 5. It allows a method or constructor to have maximum one argument that encapsulates a variable number of arguments.

  1. Varargs for methods and constructors

Those were the 49 lessons to get you up and running with Java.

We will now venture into covering more advanced features of core Java.

Leave a comment

Your email address will not be published. Required fields are marked *