core java chp 1
TRANSCRIPT
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 1/10
Core Java Chapter 1
Presented by,
Soe Min Htut
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 2/10
Content•
Chapter 1 Hello Java• Chapter 2 Java Fundamental
• Chapter 3 Java OOP
• Chapter 4 GUI (AWT & SWING)
• Chapter 5 Generic and Data Collection• Chapter 6 Java Input and Output (IO)
• Chapter 7 Java Thread
•
Chapter 8 Java & Database (mysql)
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 3/10
Chapter (1) Hello Java
• Java – Pogramming language originally developed James
Gosling and released in 1995
• Java usage
– Open-source software – Write Once, Run Anywhere (Windows, Mac Os,
Solaris, Linux, other)
– Object model, platform independent, architectureneutral, simple, secure, portable, robust, multi-
threaded, distributed, dynamic
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 4/10
•
Java architecture
Chapter (1) Hello Java
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 5/10
• JRE, JDK and JVM
– Java Runtime Environment (JRE): minimum requirement to run java
– Java Development Kit (JDK): provides all requires to compile andexecute java for developers
– Java Virtual Machine (JVM): is created when it downloads andruns JRE or JDK
• Windows system requirements for JDK and JRE
– Pentium 2.266 MHz processor, memory 128 MB,
disk space 94 MB (JRE) and 180 MB (JDK)
• Software requirements for our learning
– JDK, Mysql, Netbeans and Notepad++
Chapter (1) Hello Java
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 6/10
• Configuration JDK to run java from command prompt – Uninstall older version of JDK/JRE: „Control Panel‟ Un-install programs
„Java SE Development Kit‟ and „Java SE Runtime‟
– Go to Java SE download @http://www.oracle.com/technetwork/java/javase/downloads/index.html.
– Click the „Download‟ button under „JDK‟ of „Java SE 7‟
– Choose your OS e.g: Windows x86 (32-bit) or Windows x64 (64-bit)
– By default, JDK will be installed into directory: „C:\Program Files\java\Jdk1.7.0‟
– „Control Panel‟ „System‟ „Advanced system settings‟
– „Advanced‟ tab „Environment Variables‟
– In „System Variables‟ box, scroll down to select „PATH‟ „Edit‟
– In „Variable value‟ field, insert „c:\Program Files\java\jdk1.7.0\ bin‟ followed by asemicolon (;)
– C:\> java – version, C:\> javac
Chapter (1) Hello Java
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 7/10
• First hello java program – Java source file extension: FirstJava.java
class FirstJava {
public static void main (String[] args) {
System.out.println("Hello Java");
}}
C:\> javac FirstJava.java
– Java compiled sources (bytecode): FirstJava.class
C:\> java FirstJava
Chapter (1) Hello Java
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 8/10
• Java class – Java class can be called as java program
• Java code block (braces) – It defines by curly brackets { }
• Java main method
– Methods describe the capabilities of the class. – Every method must be called from another method. The only
exception is main(), which is called by the OS.
– Methods can accept parameters.
public static void main (String args[]) { … }
•
Java is case sensitive
Chapter (1) Hello Java
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 9/10
• Java dot operator: . – A.B ( A => B)
• Single line comment: //
•
Multiple lines comment: /* */• Three types of error
– (1) compile-time error
– (2) run-time error
– (3) logical error
AB
Chapter (1) Hello Java
7/29/2019 Core Java Chp 1
http://slidepdf.com/reader/full/core-java-chp-1 10/10
• Installation NetBeans – Download “ NetBeans IDE” installer from
http://netbeans.org/downloads/index.html
– Run the downloaded installer
•
Writing a java program in NetBeans – File menu New Project
– In “Choose Project” dialogue under Categories, Java chooseJava Application
– “Name and Location” In “Project Name”, enter “FirstJava”
• Compile & Execute – Right-click “Run File”
Chapter (1) Hello Java