java fundamentals - courses.cs.ut.ee · previously on java fundamentals … • ~40 people started...

35
Java Fundamentals Toomas Römer @toomasr 2016, Tartu

Upload: vanhanh

Post on 12-May-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Java FundamentalsToomas Römer

@toomasr 2016, Tartu

Page 2: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

A long time ago in a galaxy, far away

•2012 - MTAT.03.279

•Java Fundamentals - Java alusehitus

•2012, 2014 - Tartu University

•2013 - Tallinn Technical University)

Page 3: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Fundamentals?

Page 4: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Why are we doing this?

Page 5: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •
Page 6: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Why are we doing this?

• We love Java and like to spread this love!

• Java is a great technology to invest in!

• Our small way of giving back …

Page 7: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •
Page 8: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Why are YOU doing this?

Page 9: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Previously on Java Fundamentals …

• ~40 people started with the course

• ~20 finished with a grade

• ~5 forgot to de-register

• #protip Deregister from the course early!!!

Page 10: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Team

Page 11: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Course• 3 EAP ~ 78 hours of work

• 15 lectures

• 14 homework problems (might change!)

• Tuesdays @ 16:15-17:45 @ Liivi 2 @ 404

• Info @ https://courses.cs.ut.ee/2016/javaFund/fall

• Contact [email protected]

Page 12: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Homework• 14 assignments (might change)

• Each assignment scored 0.0 - 1.0

• Want to get to the exam?

• Get at least 50% of the assignment points!

• Too harsh?

• Okay, we won’t take into account 2 worse submissions

Page 13: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Homework

• 14 assignments

• We won’t count 2, so actually 12 assignments

• Maximum points will be 12

• You need 6 points to get to the exam!

Page 14: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Exam

• Written

• 60% of the exam score

• Oral

• 40% of the exam score

Page 15: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Final Grade• 50% assignments

• We won’t count the scores of 2 of the worst submissions

• 50% exam

• Prerequisite: must get 50% of all the assignment scores

• 60% written

• 40% oral

Page 16: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Homework

• Hard limit for the homework

• If you are late then you’ll get no points

• If you are late, we won’t even look into it

• Deadline is the next Monday 23:59 EEST

Page 17: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Expectations• You understand Java

• Know how to use an IDE

• Know about Maven

• Can read, write and understand English :)

• Know how to send emails

Page 18: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

• JDK8

• Maven (3.3)

• IDE

• JUnit

• Git

Expectations

Page 19: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Course• Collections, Generics, Lambdas, Streams

• Java IO, NIO.2, Networking, Threads

• Memory Model/Management, Concurrency API

• Classloaders

• Reflection API, Dynamics Proxies, Extending JVM

• Java Troubleshooting, Performance

• Some Android …

Page 20: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Homework Demo

Page 21: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

https://github.com/JavaFundamentalsZT/jf-skeleton

Page 22: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

• Clone with Git$ git clone [email protected]:JavaFundamentalsZT/jf-skeleton.git jf2016-hw1

OR

• Download ZIPhttps://github.com/zeroturnaround/jf-skeleton/archive/master.zip

Page 23: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

!"" README.md!"" pom.xml#"" src !"" main $   #"" java $   #"" ee $   #"" ut $   #"" jf2016 $   !"" Main.java $   #"" homework1 $   #"" Homework.java #"" test #"" java #"" ee #"" ut #"" jf2016 #"" homework1 #"" HomeworkTests.java

Page 24: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

• cd jf2016-hw#

• mvn install

• java -jar target/jf2016-executable.jar

Page 25: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

• mvn clean deployYour full name (e.g. John Smith):Jane SmithYour Student Book Number (matrikli number, e.g. B12345):B12345Homework number:1Comment:Java IO

• Attach target/jf-homework-B12345-1.zipand submit to [email protected]

Page 26: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

Puzzlers

Page 27: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

System.out.println ( 10 / 3 );

System.out.println ( 10 / 6 );

Page 28: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

/**

* Generated by the IBM IDL-to-Java compiler, version 1.0

* from F:\TestRoot\apps\a1\units\include\PolicyHome.idl

* Wednesday, June 17, 1998 6:44:40 o’clock AM GMT+00:00

*/

public class Test {

public static void main(String[] args) {

System.out.print("Hell");

System.out.println("o world");

}

}

Page 29: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

/**

* Generated by the IBM IDL-to-Java compiler, version 1.0

* from F:\TestRoot\apps\a1\units\include\PolicyHome.idl * Wednesday, June 17, 1998 6:44:40 o’clock AM GMT+00:00

*/

error: illegal unicode escape * from F:\TestRoot\apps\a1\units\include\PolicyHome.idl ^1 error

Page 30: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

public class DosEquis { public static void main(String[] args) { char x = 'X'; int i = 0; System.out.print(true ? x : 0); System.out.print(false ? i : x); }}

Page 31: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

X88

Page 32: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

System.out.println(12345 + 5432l);

Page 33: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

17777

System.out.println(12345 + 5432L);

Page 34: Java Fundamentals - courses.cs.ut.ee · Previously on Java Fundamentals … • ~40 people started with the course • ~20 finished with a grade • ~5 forgot to de-register •

public boolean indecision() { try { throw new Exception(); } finally { return false; }}