SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
Java course - IAG0040




              Introduction




Anton Keks                           2011
About Me
 ●
     Anton Keks
         –   Co-founder of Codeborne, an agile company
         –   Previously, team leader in Swedbank
         –   Strong believer in Open Source software
         –   Author of Angry IP Scanner
         –   Passionate traveler
         –   Likes motivated students :-)
 ●   Contact
         –   anton @ azib.net
             (Estonian, Russian, English)
Java course – IAG0040                                    Lecture 1
Anton Keks                                                 Slide 2
The Course
 ●
     IAG0040
 ●   “Programmeerimise erikursus II - Java”
     “Special course in programming II - Java”
 ●
     5.0 EAP / 3.5 AP
 ●   In IASM curriculum, but anybody is welcome!
 ●
     Can be substitued for "Programmeerimine II"
 ●   The official site: http://java.azib.net/


Java course – IAG0040                              Lecture 1
Anton Keks                                           Slide 3
Prerequisites
 ●
     It is recommended to
         –   know basics of OOP
             (Object-oriented programming)
         –   be familiar with C and C++
 ●   It is required to
         –   have a will to study and become a true
             professional




Java course – IAG0040                                 Lecture 1
Anton Keks                                              Slide 4
How to pass?
 ●
     Do the homework (max 50 p)
 ●   Pass the exam (max 50 p)
 ●   Optionally participate in Robocode
     competition (max 10 p extra)

 ●   Standard rules for mark computation:
     –   finalPoints = homework + robocode + exam;
     –   mark = Math.min((finalPoints - 50) / 10, 5);


Java course – IAG0040                           Lecture 1
Anton Keks                                        Slide 5
Homework
 ●
     The task is published on the official website
     http://java.azib.net/wiki/Homework
     (minor details may change)
 ●
     Must work, have good design, quality code
 ●
     Source code must be committed to Subversion
 ●   Deadline is to be defined, close to the end of
     the semester



Java course – IAG0040                           Lecture 1
Anton Keks                                        Slide 6
Robocode
 ●
     Competition of robot tanks programmed in
     Java
 ●   Initiated by IBM
 ●
     http://robocode.sourceforge.net/
 ●   A fun way of learning Java language
 ●   Competition will be organized



Java course – IAG0040                       Lecture 1
Anton Keks                                    Slide 7
Registration & Test



                    Course registration and test:

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



Java course – IAG0040                               Lecture 1
Anton Keks                                            Slide 8
Version Control
 ●
     Historically, there were formalized processes
     for revision control, e.g. in engineering, law,
     business
     –   allowed to revert to an earlier version in case of
         reaching a dead-end in design
     –   allowed to track authors and dates of changes
 ●
     The earliest VCS for software engineering was
     similar - just manual copying


Java course – IAG0040                                   Lecture 1
Anton Keks                                                Slide 9
VCS History
 ●
     1972: SCCS (Source Code Control System)
     –   was unique because of the 'weaves' (storage)
 ●
     1980s: RCS (Revision Control System)
     –   for single files only, still used in specific cases
 ●
     1986: CVS (Concurrent Versions System)
     –   initially shell script wrappers for RCS to manage
         multiple files at once
 ●
     2000: Subversion
     –   a YACC (Yet Another CVS Clone)
Java course – IAG0040                                      Lecture 1
Anton Keks                                                  Slide 10
Subversion
 ●   A Version Control System (VCS)
 ●   Is a 'better CVS'
 ●   Allows many developers to work on the same code
     base
 ●   Supports development on different branches in
     parallel
 ●   Tracks modification history
 ●   Allows restoration and rollbacks
 ●   A lot of other possibilities!
Java course – IAG0040                           Lecture 1
Anton Keks                                       Slide 11
Subversion
 ●
     Subversion repository is accessible using URLs
         –   http:// or https:// - WebDAV, https can be
             proxied
         –   svn:// or svn+ssh:// - native protocol (and over
             ssh)
         –   file:// - local repository
 ●
     During the course we will use this one:
         –   https://svn.azib.net/java

Java course – IAG0040                                     Lecture 1
Anton Keks                                                 Slide 12
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
     sequential revision number to the whole commit.
 ●   trunk - the main development tree in the repository.
 ●   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 13
Repository layout
 ●
     Standard top-level directories
     –   trunk – the main development tree
     –   branches – for parallel development
     –   tags – labeled states of the tree (released versions)
     –   all of them contain the same project structure
         inside
 ●   Branching is done via 'svn copy' command
     –   copies are cheap – only changes are stored
     –   switch to another branch via 'svn switch'
Java course – IAG0040                                   Lecture 1
Anton Keks                                               Slide 14
Project structure
 ●
     Most Java projects have the following top-
     level elements:
         –   src - main Java source code (deliverable)
         –   test - automated tests (also written in Java)
         –   lib - used external libraries (jar files)
         –   build.xml - Ant build script, used for continuous
             integration




Java course – IAG0040                                    Lecture 1
Anton Keks                                                Slide 15
Java History
 ●
     Initially developed as an embedded
     language for interactive TV consoles,
     initially 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
     dominating programming language
Java course – IAG0040                        Lecture 1
Anton Keks                                    Slide 16
Most used in...
 ●
     Server-side enterprise applications
 ●   JavaME/CLDC – mobile apps/games
 ●   Blue-Ray
 ●   Google Android mobile platform
 ●
     Some cross-platform desktop software




Java course – IAG0040                       Lecture 1
Anton Keks                                   Slide 17
Latest major news
 ●
     Sun Microsystems acquired by Oracle - 2010
 ●   Java became open-source (OpenJDK) - 2007
 ●   Java 1.6 released in November 2006
 ●   Java 1.5 discontinued in November 2009
 ●
     Development of Java 1.7 is still in progress




Java course – IAG0040                           Lecture 1
Anton Keks                                       Slide 18
3-letter acronyms
 ●
     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 = language + JVM + API



Java course – IAG0040                       Lecture 1
Anton Keks                                   Slide 19
Java versions
 ●
     Java 1.0 – first public release
 ●
     Java 1.1 – JIT, 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 1.7 & 1.8 – many new language features are
     planned
Java course – IAG0040                                    Lecture 1
Anton Keks                                                Slide 20
Java flavors
 ●
     Java SE – standard edition (J2SE)
 ●
     Java EE – enterprise edition (J2EE)
 ●
     Java ME – micro/mobile edition (J2ME)
 ●   Java Card – for smart cards

 ●
     Sun Java – official
 ●   IBM Java SDK
 ●   GNU Java – gcj & gij
 ●   Icedtea – early releases of OpenJDK 1.7
 ●   and others
Java course – IAG0040                          Lecture 1
Anton Keks                                      Slide 21
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 22
Java classification
 ●
     Java language is
         –   general-purpose
         –   object-oriented
         –   static
         –   strongly typed
         –   memory safe
         –   compiled, but bytecode-interpreted



Java course – IAG0040                             Lecture 1
Anton Keks                                         Slide 23
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 24
Java vs C++
 ●   Java is loosely 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 25
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 HelloWorld
     (means run class HelloWorld, by default look for it in the current directory)


Java course – IAG0040                                                                Lecture 1
Anton Keks                                                                            Slide 26
IntelliJ IDEA
 ●
     The “smartest” Java IDE around
 ●   Now has a free Community Edition
     –   Syntax highlighting
     –   Code completion, suggestions, templates
     –   Refactorings
     –   Integrated Subversion support
 ●   With practice your productivity can increase
     multiple times (learn shortcut keys)

Java course – IAG0040                              Lecture 1
Anton Keks                                          Slide 27
Initial Setup



   IntelliJ IDEA and Subversion are our main tools
    during this course, prepare yourself using this
                        guide:

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



Java course – IAG0040                             Lecture 1
Anton Keks                                         Slide 28
Continuous integration
 ●
     Regular automated builds of the software (e.g.
     after each commit)
         –   the whole program is recompiled
         –   automated tests are run
         –   documentation is generated
         –   software is packaged and therefore ready to run




Java course – IAG0040                                  Lecture 1
Anton Keks                                              Slide 29
Benefits of CI
 ●
     Provides quick feedback to developers
 ●
     Reduces wasted time of the team due to broken code
 ●
     Helps to find integration problems and failed tests
     early
 ●   The latest builds are always runnable and testable by
     e.g. customers
 ●   Hudson is one of the tools often used for this purpose
         –   http://java.azib.net/hudson
         –   it will send you automatic mails if you are guilty!

Java course – IAG0040                                      Lecture 1
Anton Keks                                                  Slide 30
Classes
 ●
     Basically, all you do in Java is define classes
     –   everything else is inside of them:
         fields, methods, code instructions
 ●
     Class names are in “CamelCase”
     – HelloWorld, String, BigDecimal
 ●   class MyClass { /*body here*/ }
 ●   Public classes must be defined in files with
     same names

Java course – IAG0040                               Lecture 1
Anton Keks                                           Slide 31
Packages
 ●
     Classes generally reside in packages
 ●
     Specified in the beginning of the file:
     –   package net.azib.java;
     –   names usually start with domain name of the author
     –   package is optional (but highly recommended)
 ●
     Each dot-separated token represents a directory
     –   net.azib.java.HelloWorld class should reside in
         net/azib/java/HelloWord.class file on the disk
 ●   Classes are referenced by their full names unless
     imported: import net.azib.java.HelloWorld;
Java course – IAG0040                                   Lecture 1
Anton Keks                                               Slide 32

Weitere ähnliche Inhalte

Was ist angesagt?

Java Course 13: JDBC & Logging
Java Course 13: JDBC & LoggingJava Course 13: JDBC & Logging
Java Course 13: JDBC & LoggingAnton Keks
 
Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Kernel Training
 
Core Java Certification
Core Java CertificationCore Java Certification
Core Java CertificationVskills
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeOmar Bashir
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to javaAjay Sharma
 
Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz SAurabh PRajapati
 
Java Presentation For Syntax
Java Presentation For SyntaxJava Presentation For Syntax
Java Presentation For SyntaxPravinYalameli
 
Java Course 14: Beans, Applets, GUI
Java Course 14: Beans, Applets, GUIJava Course 14: Beans, Applets, GUI
Java Course 14: Beans, Applets, GUIAnton Keks
 
Core Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika TutorialsCore Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika TutorialsMahika Tutorials
 
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...Sagar Verma
 
Introduction to java 101
Introduction to java 101Introduction to java 101
Introduction to java 101kankemwa Ishaku
 
What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)Shaharyar khan
 
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIsCS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIsKwangshin Oh
 

Was ist angesagt? (20)

Java Course 13: JDBC & Logging
Java Course 13: JDBC & LoggingJava Course 13: JDBC & Logging
Java Course 13: JDBC & Logging
 
Core Java Tutorial
Core Java TutorialCore Java Tutorial
Core Java Tutorial
 
Core Java introduction | Basics | free course
Core Java introduction | Basics | free course Core Java introduction | Basics | free course
Core Java introduction | Basics | free course
 
Core Java Certification
Core Java CertificationCore Java Certification
Core Java Certification
 
Core java
Core java Core java
Core java
 
An Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and RuntimeAn Introduction to Java Compiler and Runtime
An Introduction to Java Compiler and Runtime
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz Java history, versions, types of errors and exception, quiz
Java history, versions, types of errors and exception, quiz
 
Core Java
Core JavaCore Java
Core Java
 
Java Presentation For Syntax
Java Presentation For SyntaxJava Presentation For Syntax
Java Presentation For Syntax
 
Core java
Core javaCore java
Core java
 
Java Course 14: Beans, Applets, GUI
Java Course 14: Beans, Applets, GUIJava Course 14: Beans, Applets, GUI
Java Course 14: Beans, Applets, GUI
 
Core java
Core javaCore java
Core java
 
Core Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika TutorialsCore Java Tutorials by Mahika Tutorials
Core Java Tutorials by Mahika Tutorials
 
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
 
Java basic
Java basicJava basic
Java basic
 
Introduction to java 101
Introduction to java 101Introduction to java 101
Introduction to java 101
 
What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)What is Java Technology (An introduction with comparision of .net coding)
What is Java Technology (An introduction with comparision of .net coding)
 
Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIsCS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
 

Ähnlich wie Java Course 1: Introduction

The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of JavaFu Cheng
 
JAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptxJAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptx20EUEE018DEEPAKM
 
01-Introduction.ppt
01-Introduction.ppt01-Introduction.ppt
01-Introduction.pptEmanAsem4
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxMurugesh33
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxMurugesh33
 
Lecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastLecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastUzairSaeed18
 
01. Introduction to programming with java
01. Introduction to programming with java01. Introduction to programming with java
01. Introduction to programming with javaIntro C# Book
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Martijn Verburg
 
Introduction to java
Introduction to java Introduction to java
Introduction to java Java Lover
 
OOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptxOOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptxTanzila Kehkashan
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containersDocker, Inc.
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Arun Gupta
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with serverEugene Yokota
 
Why JVM will outlive java?
Why JVM will outlive java?Why JVM will outlive java?
Why JVM will outlive java?Ram Lakshmanan
 

Ähnlich wie Java Course 1: Introduction (20)

The Evolution of Java
The Evolution of JavaThe Evolution of Java
The Evolution of Java
 
JAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptxJAVA-History-buzzwords-JVM_architecture.pptx
JAVA-History-buzzwords-JVM_architecture.pptx
 
01-Introduction.ppt
01-Introduction.ppt01-Introduction.ppt
01-Introduction.ppt
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
 
Java Introduction
Java IntroductionJava Introduction
Java Introduction
 
Lecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 FastLecture-01 _Java Introduction CS 441 Fast
Lecture-01 _Java Introduction CS 441 Fast
 
01. Introduction to programming with java
01. Introduction to programming with java01. Introduction to programming with java
01. Introduction to programming with java
 
Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)Introduction to Java 7 (OSCON 2012)
Introduction to Java 7 (OSCON 2012)
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
Introduction to java
Introduction to java Introduction to java
Introduction to java
 
How can your applications benefit from Java 9?
How can your applications benefit from Java 9?How can your applications benefit from Java 9?
How can your applications benefit from Java 9?
 
OOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptxOOP Lecture 1-Intro to Java.pptx
OOP Lecture 1-Intro to Java.pptx
 
Java in a world of containers
Java in a world of containersJava in a world of containers
Java in a world of containers
 
Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018Java in a World of Containers - DockerCon 2018
Java in a World of Containers - DockerCon 2018
 
JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1JAVA INTRODUCTION - 1
JAVA INTRODUCTION - 1
 
Java 1
Java 1Java 1
Java 1
 
Road to sbt 1.0 paved with server
Road to sbt 1.0   paved with serverRoad to sbt 1.0   paved with server
Road to sbt 1.0 paved with server
 
Why JVM will outlive java?
Why JVM will outlive java?Why JVM will outlive java?
Why JVM will outlive java?
 
1.Intro--Why Java.pptx
1.Intro--Why Java.pptx1.Intro--Why Java.pptx
1.Intro--Why Java.pptx
 

Mehr von Anton Keks

Being a professional software tester
Being a professional software testerBeing a professional software tester
Being a professional software testerAnton Keks
 
Java Course 11: Design Patterns
Java Course 11: Design PatternsJava Course 11: Design Patterns
Java Course 11: Design PatternsAnton Keks
 
Java Course 10: Threads and Concurrency
Java Course 10: Threads and ConcurrencyJava Course 10: Threads and Concurrency
Java Course 10: Threads and ConcurrencyAnton Keks
 
Java Course 9: Networking and Reflection
Java Course 9: Networking and ReflectionJava Course 9: Networking and Reflection
Java Course 9: Networking and ReflectionAnton Keks
 
Java Course 8: I/O, Files and Streams
Java Course 8: I/O, Files and StreamsJava Course 8: I/O, Files and Streams
Java Course 8: I/O, Files and StreamsAnton Keks
 
Choose a pattern for a problem
Choose a pattern for a problemChoose a pattern for a problem
Choose a pattern for a problemAnton Keks
 
Simple Pure Java
Simple Pure JavaSimple Pure Java
Simple Pure JavaAnton Keks
 
Database Refactoring
Database RefactoringDatabase Refactoring
Database RefactoringAnton Keks
 
Scrum is not enough - being a successful agile engineer
Scrum is not enough - being a successful agile engineerScrum is not enough - being a successful agile engineer
Scrum is not enough - being a successful agile engineerAnton Keks
 
Being a Professional Software Developer
Being a Professional Software DeveloperBeing a Professional Software Developer
Being a Professional Software DeveloperAnton Keks
 

Mehr von Anton Keks (10)

Being a professional software tester
Being a professional software testerBeing a professional software tester
Being a professional software tester
 
Java Course 11: Design Patterns
Java Course 11: Design PatternsJava Course 11: Design Patterns
Java Course 11: Design Patterns
 
Java Course 10: Threads and Concurrency
Java Course 10: Threads and ConcurrencyJava Course 10: Threads and Concurrency
Java Course 10: Threads and Concurrency
 
Java Course 9: Networking and Reflection
Java Course 9: Networking and ReflectionJava Course 9: Networking and Reflection
Java Course 9: Networking and Reflection
 
Java Course 8: I/O, Files and Streams
Java Course 8: I/O, Files and StreamsJava Course 8: I/O, Files and Streams
Java Course 8: I/O, Files and Streams
 
Choose a pattern for a problem
Choose a pattern for a problemChoose a pattern for a problem
Choose a pattern for a problem
 
Simple Pure Java
Simple Pure JavaSimple Pure Java
Simple Pure Java
 
Database Refactoring
Database RefactoringDatabase Refactoring
Database Refactoring
 
Scrum is not enough - being a successful agile engineer
Scrum is not enough - being a successful agile engineerScrum is not enough - being a successful agile engineer
Scrum is not enough - being a successful agile engineer
 
Being a Professional Software Developer
Being a Professional Software DeveloperBeing a Professional Software Developer
Being a Professional Software Developer
 

Kürzlich hochgeladen

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Kürzlich hochgeladen (20)

GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Java Course 1: Introduction

  • 1. Java course - IAG0040 Introduction Anton Keks 2011
  • 2. About Me ● Anton Keks – Co-founder of Codeborne, an agile company – Previously, team leader in Swedbank – Strong believer in Open Source software – Author of Angry IP Scanner – Passionate traveler – Likes motivated students :-) ● Contact – anton @ azib.net (Estonian, Russian, English) Java course – IAG0040 Lecture 1 Anton Keks Slide 2
  • 3. The Course ● IAG0040 ● “Programmeerimise erikursus II - Java” “Special course in programming II - Java” ● 5.0 EAP / 3.5 AP ● In IASM curriculum, but anybody is welcome! ● Can be substitued for "Programmeerimine II" ● The official site: http://java.azib.net/ Java course – IAG0040 Lecture 1 Anton Keks Slide 3
  • 4. Prerequisites ● It is recommended to – know basics of OOP (Object-oriented programming) – be familiar with C and C++ ● It is required to – have a will to study and become a true professional Java course – IAG0040 Lecture 1 Anton Keks Slide 4
  • 5. How to pass? ● Do the homework (max 50 p) ● Pass the exam (max 50 p) ● Optionally participate in Robocode competition (max 10 p extra) ● Standard rules for mark computation: – finalPoints = homework + robocode + exam; – mark = Math.min((finalPoints - 50) / 10, 5); Java course – IAG0040 Lecture 1 Anton Keks Slide 5
  • 6. Homework ● The task is published on the official website http://java.azib.net/wiki/Homework (minor details may change) ● Must work, have good design, quality code ● Source code must be committed to Subversion ● Deadline is to be defined, close to the end of the semester Java course – IAG0040 Lecture 1 Anton Keks Slide 6
  • 7. Robocode ● Competition of robot tanks programmed in Java ● Initiated by IBM ● http://robocode.sourceforge.net/ ● A fun way of learning Java language ● Competition will be organized Java course – IAG0040 Lecture 1 Anton Keks Slide 7
  • 8. Registration & Test Course registration and test: http://java.azib.net/questionnaire/ Java course – IAG0040 Lecture 1 Anton Keks Slide 8
  • 9. Version Control ● Historically, there were formalized processes for revision control, e.g. in engineering, law, business – allowed to revert to an earlier version in case of reaching a dead-end in design – allowed to track authors and dates of changes ● The earliest VCS for software engineering was similar - just manual copying Java course – IAG0040 Lecture 1 Anton Keks Slide 9
  • 10. VCS History ● 1972: SCCS (Source Code Control System) – was unique because of the 'weaves' (storage) ● 1980s: RCS (Revision Control System) – for single files only, still used in specific cases ● 1986: CVS (Concurrent Versions System) – initially shell script wrappers for RCS to manage multiple files at once ● 2000: Subversion – a YACC (Yet Another CVS Clone) Java course – IAG0040 Lecture 1 Anton Keks Slide 10
  • 11. Subversion ● A Version Control System (VCS) ● Is a 'better CVS' ● Allows many developers to work on the same code base ● Supports development on different branches in parallel ● Tracks modification history ● Allows restoration and rollbacks ● A lot of other possibilities! Java course – IAG0040 Lecture 1 Anton Keks Slide 11
  • 12. Subversion ● Subversion repository is accessible using URLs – http:// or https:// - WebDAV, https can be proxied – svn:// or svn+ssh:// - native protocol (and over ssh) – file:// - local repository ● During the course we will use this one: – https://svn.azib.net/java Java course – IAG0040 Lecture 1 Anton Keks Slide 12
  • 13. 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 sequential revision number to the whole commit. ● trunk - the main development tree in the repository. ● 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 13
  • 14. Repository layout ● Standard top-level directories – trunk – the main development tree – branches – for parallel development – tags – labeled states of the tree (released versions) – all of them contain the same project structure inside ● Branching is done via 'svn copy' command – copies are cheap – only changes are stored – switch to another branch via 'svn switch' Java course – IAG0040 Lecture 1 Anton Keks Slide 14
  • 15. Project structure ● Most Java projects have the following top- level elements: – src - main Java source code (deliverable) – test - automated tests (also written in Java) – lib - used external libraries (jar files) – build.xml - Ant build script, used for continuous integration Java course – IAG0040 Lecture 1 Anton Keks Slide 15
  • 16. Java History ● Initially developed as an embedded language for interactive TV consoles, initially 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 dominating programming language Java course – IAG0040 Lecture 1 Anton Keks Slide 16
  • 17. Most used in... ● Server-side enterprise applications ● JavaME/CLDC – mobile apps/games ● Blue-Ray ● Google Android mobile platform ● Some cross-platform desktop software Java course – IAG0040 Lecture 1 Anton Keks Slide 17
  • 18. Latest major news ● Sun Microsystems acquired by Oracle - 2010 ● Java became open-source (OpenJDK) - 2007 ● Java 1.6 released in November 2006 ● Java 1.5 discontinued in November 2009 ● Development of Java 1.7 is still in progress Java course – IAG0040 Lecture 1 Anton Keks Slide 18
  • 19. 3-letter acronyms ● 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 = language + JVM + API Java course – IAG0040 Lecture 1 Anton Keks Slide 19
  • 20. Java versions ● Java 1.0 – first public release ● Java 1.1 – JIT, 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 1.7 & 1.8 – many new language features are planned Java course – IAG0040 Lecture 1 Anton Keks Slide 20
  • 21. Java flavors ● Java SE – standard edition (J2SE) ● Java EE – enterprise edition (J2EE) ● Java ME – micro/mobile edition (J2ME) ● Java Card – for smart cards ● Sun Java – official ● IBM Java SDK ● GNU Java – gcj & gij ● Icedtea – early releases of OpenJDK 1.7 ● and others Java course – IAG0040 Lecture 1 Anton Keks Slide 21
  • 22. 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 22
  • 23. Java classification ● Java language is – general-purpose – object-oriented – static – strongly typed – memory safe – compiled, but bytecode-interpreted Java course – IAG0040 Lecture 1 Anton Keks Slide 23
  • 24. 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 24
  • 25. Java vs C++ ● Java is loosely 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 25
  • 26. 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 HelloWorld (means run class HelloWorld, by default look for it in the current directory) Java course – IAG0040 Lecture 1 Anton Keks Slide 26
  • 27. IntelliJ IDEA ● The “smartest” Java IDE around ● Now has a free Community Edition – Syntax highlighting – Code completion, suggestions, templates – Refactorings – Integrated Subversion support ● With practice your productivity can increase multiple times (learn shortcut keys) Java course – IAG0040 Lecture 1 Anton Keks Slide 27
  • 28. Initial Setup IntelliJ IDEA and Subversion are our main tools during this course, prepare yourself using this guide: http://java.azib.net/wiki/Setup Java course – IAG0040 Lecture 1 Anton Keks Slide 28
  • 29. Continuous integration ● Regular automated builds of the software (e.g. after each commit) – the whole program is recompiled – automated tests are run – documentation is generated – software is packaged and therefore ready to run Java course – IAG0040 Lecture 1 Anton Keks Slide 29
  • 30. Benefits of CI ● Provides quick feedback to developers ● Reduces wasted time of the team due to broken code ● Helps to find integration problems and failed tests early ● The latest builds are always runnable and testable by e.g. customers ● Hudson is one of the tools often used for this purpose – http://java.azib.net/hudson – it will send you automatic mails if you are guilty! Java course – IAG0040 Lecture 1 Anton Keks Slide 30
  • 31. Classes ● Basically, all you do in Java is define classes – everything else is inside of them: fields, methods, code instructions ● Class names are in “CamelCase” – HelloWorld, String, BigDecimal ● class MyClass { /*body here*/ } ● Public classes must be defined in files with same names Java course – IAG0040 Lecture 1 Anton Keks Slide 31
  • 32. Packages ● Classes generally reside in packages ● Specified in the beginning of the file: – package net.azib.java; – names usually start with domain name of the author – package is optional (but highly recommended) ● Each dot-separated token represents a directory – net.azib.java.HelloWorld class should reside in net/azib/java/HelloWord.class file on the disk ● Classes are referenced by their full names unless imported: import net.azib.java.HelloWorld; Java course – IAG0040 Lecture 1 Anton Keks Slide 32