Lecture 01
Lecture 01
Lecture 01
Swakkhar Shatabda
Course Website:
swakkhar.github.io/java.html
Schedule
Sunday, Tuesday, Room # 105 11:20AM-12:40PM
Grading
Assignment+Class Performance - 10%
Class Test - 20 % (best 2)
Mid Exam - 30%
Final Exam - 40%
Text Book
Java: The Complete Reference, 9th Edition, Herbert Schildt
References
1 Java: How to Program, 9th Edition, Deitel and Deitel
The language was initially called Oak after an oak tree that stood
outside Gosling’s office. Later the project went by the name Green
and was finally renamed Java, from Java coffee.
Object-Oriented
Pure OOP!
No free functions.
All code belong to some class.
Syntax derived from C.
Object Oriented features are influenced by C++.
JDK
Use latest JDK (JDK 8 from Oracle or OpenJDK)
$ javac Welcome.java - Compiles a java file and produces
Welcom.class (byte code)
$ java Welcome - It runs java byte code on native machine
1 Class Loader
2 Verifier
3 JVM
Java IDE
1 IntelliJ IDEA
2 Eclipse
3 Netbeans
United International University CSI 211: Object Oriented Programming 11
The First Program - Guess the Output
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
Scanner myScanner=new Scanner(System.in);
A Scanner enables a program to read data
The standard input object, System.in, enables applications to
read bytes of data typed by the user.
The Scanner translates these bytes into types (like int )
Naming Convention
Classes: Nouns, in mixed case with the first letter of each
internal word capitalized. Example: CamelCase, HelloWorld.
Variables: Mixed case with a lowercase first letter. Internal
words start with capital letters. Variable names should not
start with underscore or dollar sign $ characters, even
though both are allowed. Example: myInteger, yourHome.
Methods/Functions: Methods should be verbs (similar to
variables). Example: getSize(), setSize().
Constants: Constants should be all uppercase with words
separated by underscores (” ”). Example: MAX SIZE
http://www.oracle.com/technetwork/java/codeconventions-135099.html
United International University CSI 211: Object Oriented Programming 20
Data Types
http://unicode.org/charts/PDF/U0980.pdf
United International University CSI 211: Object Oriented Programming 23
Operators: Arithmetic
Thank you