Java: An Introduction: Sanjay Saha
Java: An Introduction: Sanjay Saha
Sanjay Saha
CSI 211: Object Oriented Programming, Fall 2016
Department of Computer Science and Engineering
United International University
Course Teacher
Sanjay Saha
Lecturer, Department of CSE
United International University
Room Number: 4609
Email: [email protected]
Contact No. 01712758358
B. Sc. in CSE, DU (2014)
Continuing M.Sc. in CSE, DU (2016)
Area of Interests
Data Mining
Vehicular Networks
Web Application Development
United International University
Class Information
Course Website:
https:
//sites.google.com/a/cse.uiu.ac.bd/sanjay/courses/oop
Schedule
Monday, Wednesday, 9:55AM-11:15PM and 12:45PM-2:00PM
Grading
Assignment+Class Performance - 10%
Class Test - 20 % (best 2)
Mid Exam - 30%
Final Exam - 40%
United International University
Books
Text Book
Java: The Complete Reference, 9th Edition, Herbert Schildt
References
1 Java: How to Program, 9th Edition, Deitel and Deitel
2
What is Java?
Java Editions
10
Class Loader
Verifier
JVM
Java IDE
1 IntelliJ IDEA
2
Eclipse
Netbeans
11
12
Name of the main class should match the name of the file
that holds the program
13
Java Comments
14
A Closer Look
public static void main(String args[])
main - the starting point for any java program
public - to make this method accessible to all
static - to call this method instantiation is not needed. JVM
calls Classname.main
void - the main method does not return anything
String args[] - An array of string objects that holds the
command line arguments passed to the application
System.out.print()
Used to print a text
System - is a class in Java API (Application Program
Interface)
out - represents the standard output, static member of
System, part of API
System.out.println()
United International University
15
Escape Sequences
16
Another Program!
17
A Closer Look
import java.util.Scanner;
Java class library, or the Java Application Programming
Interface (Java API)
import declaration that helps the compiler locate a class thats
used in this program
18
Java Tips
19
20
Data Types
8 primitive types / 4 groups
1
21
22
Characters
Java char is 16 bit and stores in unicode format.
23
Operators: Arithmetic
24
Operators: Bitwise
25
Operators: Relational
C style
int flag=0;
if(flag)
{
\\ do something
}
United International University
Java style
int flag=0;
if(flag != 0)
{
\\ do something
}
26
Operators: Logical
27
Operators: Precedence
28
Scope of Variables
29
Casting
30
Reading
31
Thats it!
Thank you
32