0% found this document useful (0 votes)
3 views

Unit-01 - Basics of Java

Uploaded by

shivam84kp
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Unit-01 - Basics of Java

Uploaded by

shivam84kp
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Faculty of Engineering & Technology

Sankalchand Patel College of Engineering, Visnagar

Java Programming
( 1ET1030406 )

Unit-1 : Basics of JAVA


Prepared By
Mr. Mehul S. Patel
Department of Computer Engineering & Information Technology
Content

• Features of Java
• Byte Code and Java Virtual Machine
• JDK
• Data types
• Operator
• Variables
• Control Statements – If , else, nested if, if-else ladders, Switch, while,
do-while, for, for-each, break, continue.
Demo Example

public class FirstProgramme


{
public static void main(String args[])
{
System.out.println("Hello Java!");
}
}
Features of Java
Features of Java – Simple
• Automatic Memory Management using
Garbage Collection
• No pointer handling & Operator Overloading
• Similar friendly Syntax to C++
• Rich set of API

“Simple means not easy, Programming is


always required hard work”
Feature of Java - Secured
• Class loader
• Bytecode Verifier
• Security Manager
Feature of Java - Portable
• Machine Independent
• Platform Independent
Feature of Java - High Performance
• Intermediate Byte Code
• Multithreading
• Garbage Collector
• No Pointer
Feature of Java – Object Oriented
• Object
– Data & Behavior
• Class
• Inheritance
• Polymorphism
• Abstraction
• Encapsulation
Feature of Java - Robust
• Exception Handling
• Memory Management
- Class Loader
- Garbage Collector
• Type-Safe
Feature of Java - Multithreading
• Multi Tasking
• Concurrency
• Throughput
Feature of Java - Dynamic
• Dynamic Memory Allocation
- ‘new’ operator
• Reduce memory wastage
• Improve Performance
Byte Code
• Write-Once Run-Anywhere (WORA)
• Extension ‘.class’

C/C++ Program Execution

JAVA Program Execution


Java Virtual Machine
• Abstract Machine
• To execute Bytecode
• JRE
o Java Runtime Environment
JDK
• Java Development Kit
• To develop application
• Different for various
platforms
Data types
Primitive Data Type
Data Type Default Value Default size
boolean false 1 bit
char '\u0000' 2 byte
byte 0 1 byte
short 0 2 byte
int 0 4 byte
long 0L 8 byte
float 0.0f 4 byte
double 0.0d 8 byte
Operator
Control Statements

• Break
Jump • Continue
• return

Iteration • If
• If else
• For loop • Else if ladder
• Do loop • Nesting if else
• Do…while loop Selection • switch
Demo Example
References:
• http://www.ibm.com/developerworks/java/library/j-
codetoheap/index.html
• http://www.javamex.com/tutorials/
Questions/Comments

You might also like