Introduction to Java
Introduction to Java
INSTALLATION
• Download and Install jdk
– http://www.oracle.com/technetwork/java/javase/
downloads/index.html
• Download Eclipse Classic IDE
– http://www.eclipse.org/downloads/
• Open Eclipse IDE. Create a new folder as it will
prompt for a workspace.
– Eclipse stores your projects in a folder called a
workspace.
FEATURES
• Open Source
• Initially developed for Electronic Products
• Simple – Syntax is been derived from C/C++
programming.
• It is a platform
• Platform Independent
– WORA (Write Once, Run Anywhere) – It can be
compiled only once and can run on any platform
such as Windows, Mac, Unix, Linux, etc
FEATURES
• High Security – No Pointers are used, uses its own
environment JVM for Execution.
• Object Oriented Programming
• Robust – Java is Strong as it has strong memory
management, automatic garbage collection, exception
handling and type checking
• Distributed – allows creating distributed applications
using RMI and EJB technologies.
• Multithreaded –using threads we can execute many
tasks at a time and it shares the same memory.
• Case Sensitive – Eg: “Hello” and “hello” are different.
TYPES OF JAVA APPLICATIONS
• Standalone Applications – Also called Desktop /
Window based Applications. It uses AWT or Swings.
– Eg: Media Player, Anti-virus
• Web Applications – An Application that runs on the
server side and produces dynamic pages. JSP, Servlets,
JSF, Struts, etc are used.
• Enterprise Applications – An Application which is
distributed in nature such as Banking Application
which involves high security, load balancing, clustering,
etc. EJB technology is been used.
• Mobile Application – An Application for mobile
devices. Android and J2ME technologies are used.
FIRST JAVA PROGRAM
• Created via IDE and Command Prompt
• Open Eclipse IDE
• Open File -> New Project -> Java Project
• In Package Explorer, right click Project folder -
> New -> Class
• Specify the Class Name and click Finish
FIRST JAVA PROGRAM
• Type the following: