Advanced Java Programming Adam Gerber, PhD, SCJP office: Ryerson CS Lab 4 th Floor office hrs: 3:30-5:30pm Wed.

Slides:



Advertisements
Similar presentations
Introduction To Java Objectives For Today â Introduction To Java â The Java Platform & The (JVM) Java Virtual Machine â Core Java (API) Application Programming.
Advertisements

An Introduction By Sonali and Rasika.  Required for the project  Show the versions of your code in the course of development  Show versions of your.
Lab Information Security Using Java (Review) Lab#0 Omaima Al-Matrafi.
CERTIFICATION OBJECTIVES Use Class Members Develop Wrapper Code & Autoboxing Code Determine the Effects of Passing Variables into Methods Recognize when.
Lab#1 (14/3/1431h) Introduction To java programming cs425
Session 1 CS-240 Data Structures Binghamton University Dick Steflik.
Introduction to Java.
Session-02. Objective In this session you will learn : What is Class Loader ? What is Byte Code Verifier? JIT & JAVA API Features of Java Java Environment.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
CMSC 202 Computer Science II for Majors Fall 2009 Introduction.
CMSC 341 Introduction to Java Based on tutorial by Rebecca Hasti at
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
1 Web Design Workshop DIG 4104c Spring 2014 Dr. J. Michael Moshell University of Central Florida Lecture 2: The git source control system
Java Security. Topics Intro to the Java Sandbox Language Level Security Run Time Security Evolution of Security Sandbox Models The Security Manager.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Android Application Development android.cs.uchicago.edu.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
Java Introduction Lecture 1. Java Powerful, object-oriented language Free SDK and many resources at
Git – versioning and managing your software L. Grewe.
By Noorez Kassam Welcome to JNI. Why use JNI ? 1. You already have significantly large and tricky code written in another language and you would rather.
CSCE 2013L: Lab 1 Overview  Java Basics The JVM Anatomy of a Java Program  Object-Oriented Programming Overview  Example: Payroll.java JDK Tools and.
Lecture 2 agenda Setting-up projects properly Review git config Java event model Anatomy of and Android Application Activity Lifecycle State Changes; saving.
"If I can't picture it, I can't understand it.". Reference anonymous - gravity Concrete classes: rules of.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Drexel University Software Engineering Research Group Git for SE101 1.
…using Git/Tortoise Git
Git workflow and basic commands By: Anuj Sharma. Why git? Git is a distributed revision control system with an emphasis on speed, data integrity, and.
SWEN 302: AGILE METHODS Roma Klapaukh & Alex Potanin.
Module Overview n Module Title: OO Programming n Module Code: MIT3446 n Module Value: 3.0 n Duration: 15 weeks n Class-Contact Hours: Lecture15 hrs n Lab/Tutor30hrs.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 15: More-Advanced Concepts.
Team 708 – Hardwired Fusion Created by Nam Tran 2014.
Piazza Piazza: 037/home Course website:
Lecture 1 Introduction. Instructor Name: Seokwoo Song Office: business 524 Phone: Office Hours: M W 4:30 – 5:30 PM or by appointment
Adam Gerber, PhD, SCJP Evaluations 50% homework 20% final project (take home) 20% two in-class quizzes (not announced, so come.
Java Basics.  To checkout, use: svn co scb07f12/UTORid  Before starting coding always use: svn update.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
Intro to Git presented by Brian K. Vagnini Hosted by.
Duke CPS From C++ to Java l Java history: Oak, toaster-ovens, internet language, panacea l What it is ä O-O language, not a hybrid (cf. C++)
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
Lec 06 Agenda 1/ the 8 rules of Java 2/ Casting primitives 3/ Swing and Threading 4/ Java Event Model. Event api and support for Swing 5/ Swing labs, live.
Lecture 2 agenda flip teaching install p4merge rename project packages review git review Android Studio (Vinny) layouts and resources java event model.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Introduction to Programming 1 1 2Introduction to Java.
INTRODUCTION TO GIT. Install Egit for eclipse Open eclipse->Help->Install New Software Search for one of the following -
JAVA TRAINING IN NOIDA. JAVA Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented and specifically.
BIT 285: ( Web) Application Programming Lecture 07 : Tuesday, January 27, 2015 Git.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Introduction CMSC 202 Fall Instructors Mr. Ryan Bergeron – Lecture Section 01 Tues/Thu 1:00 – 2:15 am, Sondheim 111 – Lecture Section 04 Tues/Thu.
Evaluations 50% homework 20% final project (take home)
Object Oriented Programming in
Before You Begin Nahla Abuel-ola /WIT.
11 Version control (part 2)
Git Practice walkthrough.
Setting up Git, GitBash, and GitHub
IST256 : Applications Programming for Information Systems
Version Control overview
Website: SSD1 Unit 2 Intro to Java Presentation 2.3 Website:
Macaualy2 Workshop Berkeley 2017
Introduction Enosis Learning.
Java Virtual Machine Complete subject details are available at:
SU Development Forum Introduction to Git - Save your projects!
Akshay Narayan git up to speed with RCS Akshay Narayan
SIG: Open Week 1: GitHub Tim Choh.
Introduction Enosis Learning.
Git started with git: 2018 edition
(Computer fundamental Lab)
Java History, Editions, Version Features
ICOM 4029 Fall 2003 Lecture 2 (Adapted from Prof. Necula UCB CS 164)
Advanced Git for Beginners
Presentation transcript:

Advanced Java Programming Adam Gerber, PhD, SCJP office: Ryerson CS Lab 4 th Floor office hrs: 3:30-5:30pm Wed

Survey of the class Your name, hailing from, what you studied in undergrad, what you want to accomplish with this degree? (waive option) Android Portfolio:

Evaluations proPres 10% proData 10% proService 10% Class participation 10% Midterm exam 15% proWeb 20% (final project) Team Project 25%

Project Due Dates proPres: due Tues July 15 at 11:59pm proData: due Tues July 22 at 11:59pm proService: due Tues July 29 at 11:59pm proWeb: due Tues September 2 at 11:59pm

Team Projects Each team will be responsible for: 1/ creating a deck of slides describing the architecture of the technology Each team member will be responsible for: 1/ creating a lab using the course tools Maven/Git/NetBeans and making their lab available on bitbucket as public repo. 2/ lecturing for 1/2 hour on that lab in weeks 7, 8, or 9. See course website for dates: class.cs.uchicago.edu/adv/

Piazza Piazza: 037/home Course website:

Lecture 01 Agenda: 1/ intro 2/ bitBucket register 3/ setup dev environment JDK, maven, git, sourcetree, p4merge, netBeans 8, glassfish 4/ intro to maven, netbeans, & git

Registering Bitbucket account Remote source-control:

Set-up dev enviornment: ~/content/java_adv_install.txt

Java Java is modeled after C++ The majority of runtime errors in a C++ program are due to improper memory management (memory leaks). Java is a memory-managed environment. In practice, that means you don’t have to worry about de-allocating memory when an object which was allocated on the heap falls out of scope. Garbage collected. Since JEE and JSE 1.5+, you may let the run-time environment manage both the allocation and de- allocation of objects.

Java memory mgmt We are responsible for allocating memory on the heap using the new keyword. The JVM is responsible for de-allocating memory with the garbage collector. The finalize() method is the closest we can get to intercepting de-allocation. Date date = new Date("11/18/2007"); System.out.println(date.toString()); //program exits The run-time environment (JEE container or JVM 1.5+) is responsible for de- allocating AND allocating memory on the Date date; System.out.println(date.toString()); //program exits

Java Java is Write Once Run Anywhere (WORA). A java program can run on any platform that has a JVM. A Java WAR file can run on any JEE compliant web-server, such as Tomcat, JBoss, Wirefly, Glassfish.

What Sun (now Oracle) says about Java “…we designed Java as closely to C++ as possible in order to make the system more comprehensible. Java omits many rarely used, poorly understood, confusing features of C++ that, in our experience, bring more grief than benefit.”

Architecture Neutral Java Code is compiled to.class files which are interpreted as bytecode by the JVM. (.NET does this too; only you’re trapped in an MS op system.) JIT compilers like HotSpot are very fast – little difference between in performance between machine-binary and interpreted byte-code.

Strictly OO Java is strictly Object-Oriented. Java code must be encapsulated inside a class. No procedural programming; and no spaghetti code.

Implementation Independence A java int is ALWAYS 32bits; regardless of operating system. A java long is ALWAYS 64bits. Etc. The same is not true of C/C++.

No Pointers There are no pointers in Java Instead Java uses references; which for all intents and purposes, behave like pointers.

Version numbers in Java Jdk1.5 == Java 5.0 Jdk1.6 == Java 6.0 Jdk1.7 == Java 7.0

Wrapper Classes Every primitive has a corresponding Wrapper class. For example; double has Double, int has Integer, boolean has Boolean, char has Character, etc. These wrapper classes can be very useful when storing values in collections which require you to use objects, and forbid the use of primitives.

The API Documentation of the Standard Java Library

Object heirarchies You can also see the API online. Determine the version you using by typing> java –version Class hierarchies. The Object class is the grand-daddy of ALL java classes. Every class inherits methods from Object. And from all its other ancestry. Even if you create a class that extends no other classes, you still extend Object by default.

Class Object A blueprint is to a house as a class is to an object Class = Blueprint

Class Objects

Class Object A blueprint is to a car as a class is to an object Class = Blueprint

Class Objects

Spot the “class” here

Pass by value and reference

pass by value pass by reference Action: Tell my accountant how much I intend to spend on a new car. Change in bank account: no change. Action: Swipe debit card and enter pin at the Bently dealership. Change in bank account: -125k.

If a tree falls in a forest and no one is around to hear it, does it make a sound?

Event (onClick) No Event-Listener listening No Catcher Event-Source (Button) No Event Listener

Event (onClick) Event-Listener listening Catcher ready to catch Event-Source (Button) OnClick- Listener Any Object

Wrong Event

Event source not registered

Event (onClick) Event-Listener listening Catcher ready to catch OnClick- Listener Event-Source (Button) Any Object OnMouse- Listener Event (onMouse)

Install Maven On Windows: verify M2_HOME is created and PATH contains M2_HOME On Mac/Linux: export M2_HOME=/home/user/java/apache-maven export PATH=/home/user/java/apache-maven /bin:${PATH} mvn --version

Remote Local

Fork-and-Clone projects

GIT architecture

git config --global user.name "Your Name" git config --global user.

add/reset/commit: move files from working-dir to stage-dir(aka index) git add. git add src/. git add src/lec01/glab/DigitalToBinary.java move files from stage-dir(aka index) to working-dir git reset HEAD. git reset head src/. git reset head src/lec01/glab/DigitalToBinary.java git commit -m “your commit message.”

Amending: Every commit is associated with a sha-1 hash. That hash is derived from 1/ the file changes in that commit and 2/ the previous commit. You can not change any commit unless that commit is at the head. Since no other commits depend on the head, you may safely change the head. To change the head, use git commit --amend -m “your message” git commit --amend --no-edit

Reverting: You can roll back a commit (reverse it) by identifying it's sha1 hash like so. git revert --no-edit 71ac

Branching: To list the branches in a project: git branch git branch -r git branch --all To create a branch: git checkout -b branchName c39b git checkout -b branchName To delete a branch: git branch -D branchName To checkout a branch: git checkout 7afe git checkout master

Pushing to remotes: To see the remotes: git remote -v show To push to a remote: git push origin master:master git push origin master git push --all

Pulling from remotes: To see the remotes: git remote -v show To pull from a remote: git pull --all git pull origin eval

NetBeans keymap