Vous êtes sur la page 1sur 19

Java course - IAG0040

Introduction

Anton Keks 2007


Prerequisites
● Know basics of OOP
(Object-oriented programming)
● Be familiar with C and C++
● Will to study and become a true professional

Java course – IAG0040 Lecture 1


Anton Keks Slide 2
How to pass?
● Do the homework (max 50 p)
● Participate in Robocode competition (max 10 p)
● Pass the Exam (max 50 p)

● Standard rules for mark computation:


– finalPoints = homework + robocode + exam;
– mark = Math.min((finalPoints - 50) / 10, 5);

Java course – IAG0040 Lecture 1


Anton Keks Slide 3
Homework
● The task will be published later on the official
website - http://java.azib.net/
● Must have good design, quality code
● Source code must be committed to Subversion
● Deadline is approximately on 14th week

Java course – IAG0040 Lecture 1


Anton Keks Slide 4
Robocode
● Competition of robot tanks, written in Java
● Initiated by IBM
● http://robocode.sourceforge.net/
● A great way of learning Java
● Competition will be organized

Java course – IAG0040 Lecture 1


Anton Keks Slide 5
Registration & Test

Course registration and test:

http://java.azib.net/questionnaire/

Java course – IAG0040 Lecture 1


Anton Keks Slide 6
Java History
● Initially developed as an embedded
language for interactive TV consoles,
named Oak
● In 1995 began to target the Internet.
Renamed to Java.
● Applets were the “killer app”
● Servlets helped to survive
● Now the most successful and
dominated programming language
Java course – IAG0040 Lecture 1
Anton Keks Slide 7
Latest news
● Development of Java 1.7 started
● Java SE 6 released in November
● Java became open-source (OpenJDK)

Java course – IAG0040 Lecture 1


Anton Keks Slide 8
JDK and JRE
● JDK = Java Development Kit
used to write Java programs
● JRE = Java Runtime Environment
used to run compiled Java programs
● JVM = Java Virtual Machine
is a part of both JDK and JRE

Java course – IAG0040 Lecture 1


Anton Keks Slide 9
Java versions
● Java 1.0 – first public release
● Java 1.1 – better AWT, better unicode support
● Java 1.2 – first Java 2 release, Collections, JIT
● Java 1.3 – dynamic proxies
● Java 1.4 – XML, Regular Expressions, assertions
● Java 1.5 – aka Java 5 – lots of new language features
● Java 1.6 – aka Java 6 – scripting, better desktop

Java course – IAG0040 Lecture 1


Anton Keks Slide 10
Java flavors
● Java SE – standard edition (J2SE)
● Java ME – mobile edition (J2ME)
● Java EE – enterprise edition (J2EE)
● Java Card – for smart cards

● Sun Java – official


● IBM Java SDK
● GNU Java – gcj & gij
● and others

Java course – IAG0040 Lecture 1


Anton Keks Slide 11
The progress of abstraction
● Logic ICs, hardware
● CPU, instructions
● Assembly language
● Procedural languages: Fortran, Pascal, C
● Problem modeling languages: LISP, LabView
● Object-oriented languages: Smalltalk, C++
● Java and JVM (Java Virtual Machine)

Java course – IAG0040 Lecture 1


Anton Keks Slide 12
Main OOP concepts
● Everything is an object
● A program is a bunch of objects telling each
other what to do by sending messages
● Each object has its own memory made up of
other objects
● Every object has a type
● All objects of a particular type can receive the
same messages
● An object has state, behavior and identity
Java course – IAG0040 Lecture 1
Anton Keks Slide 13
Java vs C++
● Java is based on C++, but is more “pure”
● All objects are on the heap
● No pointers, only references
● Garbage collection
● Simplified constructs
● “Root” object: java.lang.Object
● Checked exceptions
● No multiple inheritance, but interfaces
● No operator overloading, no preprocessor, no macros
● Packages instead of namespaces
Java course – IAG0040 Lecture 1
Anton Keks Slide 14
Hello World time!!!
public class HelloWorld {
public static void main(String[] args) {
System.out.println(“Hello World!”);
}
}

● Put it into the HelloWorld.java file


● Compile with javac HelloWorld.java
(you will get a binary file HelloWorld.class)

● Run with java -cp . HelloWorld


(means run class HelloWorld, look for it in the current directory – the dot '.', cp == classpath)

Java course – IAG0040 Lecture 1


Anton Keks Slide 15
Eclipse
● Free software
● Modern
– Syntax highlighting
– Code completion
– Code assist
– Refactoring
– CVS support
– etc

Java course – IAG0040 Lecture 1


Anton Keks Slide 16
Subversion
● Version Control System (VCS)
● Is a 'better CVS'
● Allows many developers to work on the same
code base
● Supports development of different branches in
parallel
● Tracks modification history
● Allows restoration and rollbacks
● A lot of other possibilities!
Java course – IAG0040 Lecture 1
Anton Keks Slide 17
VCS/Subversion terminology
● repository - the place where Subversion holds all the files and their
revisions
● checkout - to retrieve (or sometimes update) files from the repository,
recreating exactly the same directory structure as on the server.
● commit - to finally put (or checkin) files or their modifications to the
server.
● revision - version of the repository state. Subversion assigns a single
revision number to the whole commit.
● trunk - the main development tree.
● tag - a symbolic name, given to a specific state of the repository.
● branch - a parallel branch of modifications in the source code tree,
which can be modified and committed independently from the trunk.

Java course – IAG0040 Lecture 1


Anton Keks Slide 18
Eclipse & CVS

Eclipse and Subversion are our major tools in


this course, let's play with them together!

http://java.azib.net/wiki/Java_Setup

Java course – IAG0040 Lecture 1


Anton Keks Slide 19

Vous aimerez peut-être aussi