23.11.2017 Views

java_tutorial

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Java<br />

Table of Contents<br />

About the Tutorial ............................................................................................................................................ i<br />

Audience ........................................................................................................................................................... i<br />

Prerequisites ..................................................................................................................................................... i<br />

Execute Java Online .......................................................................................................................................... i<br />

Table of Contents ............................................................................................................................................ ii<br />

JAVA – BASICS ............................................................................................................................. 1<br />

1. Java – Overview ........................................................................................................................................ 2<br />

History of Java ................................................................................................................................................. 3<br />

Tools You Will Need ......................................................................................................................................... 3<br />

Try It Option .................................................................................................................................................... 4<br />

What is Next? .................................................................................................................................................. 4<br />

2. Java - Environment Setup ......................................................................................................................... 5<br />

Try it Option Online ......................................................................................................................................... 5<br />

Local Environment Setup ................................................................................................................................. 5<br />

Popular Java Editors ........................................................................................................................................ 6<br />

What is Next? .................................................................................................................................................. 6<br />

3. Java – Basic Syntax .................................................................................................................................... 7<br />

First Java Program ........................................................................................................................................... 7<br />

Basic Syntax ..................................................................................................................................................... 8<br />

Java Identifiers ................................................................................................................................................. 9<br />

Java Modifiers.................................................................................................................................................. 9<br />

Java Variables .................................................................................................................................................. 9<br />

Java Arrays ....................................................................................................................................................... 9<br />

Java Enums .................................................................................................................................................... 10<br />

Java Keywords ............................................................................................................................................... 10<br />

Comments in Java .......................................................................................................................................... 11<br />

Using Blank Lines ........................................................................................................................................... 12<br />

Inheritance .................................................................................................................................................... 12<br />

Interfaces ....................................................................................................................................................... 12<br />

What is Next? ................................................................................................................................................ 12<br />

4. Java – Objects & Classes.......................................................................................................................... 13<br />

Objects in Java ............................................................................................................................................... 13<br />

Classes in Java ................................................................................................................................................ 14<br />

Constructors .................................................................................................................................................. 14<br />

How to Use Singleton Class? ......................................................................................................................... 15<br />

Creating an Object ......................................................................................................................................... 17<br />

Accessing Instance Variables and Methods ................................................................................................... 18<br />

Source File Declaration Rules ........................................................................................................................ 20<br />

Java Package .................................................................................................................................................. 20<br />

Import Statements ........................................................................................................................................ 21<br />

A Simple Case Study ...................................................................................................................................... 21<br />

What is Next? ................................................................................................................................................ 23<br />

ii

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!