• Getting started
Image layer 1
Image layer 2
Image layer 3
Image layer 4
Image layer 5
Image layer 6
  • Getting started
    • ➟ Lecture related resources
Image layer 1
Image layer 2
Image layer 3
Image layer 1
Image layer 2
Image layer 3
Image layer 4
Image layer 5
Image layer 6
Image layer 7
Image layer 8

Aus Der Postillion :

Mann, der am Handy

nur mal eben die Uhrzeit nachschauen wollte,

chattet acht Minuten auf WhatsApp,

schaut drei YouTube-Videos

und liest einen Artikel über Peru,

weiß aber am Ende immer noch nicht, wie spät es ist

http://codingbat.com

No registration required.

https://www.programmr.com/zone/java
  • Hunt for Challenges within page.

  • Registration required.

https://www.codewars.com
codeabbey.com

Problem list.

rosettacode.org

Programming tasks (including solutions for multiple languages).

reddit.com

Daily Programmer.

Project Euler

Registration required for keeping track of your exercises' status. The following exercises in particular are considered to be useful with respect to this lecture:

1, 2, 4, 5, 8, 9, 11.

Java Programming Tutorial

Basic and more difficult exercises

Java Programming Exercises

Start from the easier exercises.

Java Visualizer

http://prog.mi.hdm-stuttgart.de/java_visualize

Live lecture
      additions
Remote lecture
      participation
  • Contains all MI pool workstation Linux software.

  • Available for free VirtualBox desktop as compressed image.

  • The beast is quite big (~20 GB on disk, ~ 5GB compressed download provided as rar chunks)!

    Tip

    You may favour a wired connection over WIFI !

  • Alternative: Native or dual boot Ubuntu Desktop installation.

Image layer 1
Image layer 2
Image layer 3
Image layer 4
Image layer 5
Image layer 6
Image layer 7
  • Getting started
    • ➟ Using the exercises
Using the exercises
  • Getting started
    • ➟ Related resources

Either of:

  • External MI E-examination system access requires VPN:

    • Past years' E-examinations.

    • Your personal exam results.

  • OpenVPN wiki installation page (Login required).

  • HdM_MI_stud.ovpn allows for using a maximum of MI services.

  • Accessing your computer pool home directory.

  • Domain hdm, requires username hdm\xy123 for login

  • Windows share \\mi-ad1.srv.mi.hdm-stuttgart.de\xy123 or \\192.168.111.15\xy123.

  • Requires Mi VPN.

  • Getting started
    • ➟ Coached exercises
  • Tuesday and Wednesday 17:45-19:15.

  • Seminar groups of ~12 participants assigned to a tutor.

  • Precondition: You must pass the examination based on its own score excluding bonus points.

  • Examination: E.g. 90 points / 100% resulting in 1,0, 45 points / 50% resulting in 4.0.

  • 0-10 bonus points on top of examination score in case of reaching at least 50% examination points.

  • Examples:

    • 40 examination points: Failed regardless of any number of bonus points

    • 45 Examination points, 10 bonus points. Result: 55 points resulting in a 3.0 mark rather than 4.0.

  • Give a brief account of the exercise in question.

  • Explain your solution's concept and present your code.

  • Explain possible problems / pitfalls.

  • Ask your tutor for exercises to avoid thematic clashes

Image layer 1
Image layer 2
Image layer 3
  • Getting started
Image layer 1
Image layer 2
Image layer 3
Image layer 4
Image layer 5
Image layer 6
Image layer 7
Image layer 8
Editing  files
// Filename HelloWorld.java 

public class HelloWorld  {

  public static void main(String[] args)  {
    System.out.println("Hello, world"); 
  }

}
Compiling  file
~/tmp$ ls -al HelloWorld.class 
ls: cannot access 'HelloWorld.class': No such file or directory

~/tmp$ javac HelloWorld.java 

~/tmp$ ls -al HelloWorld.class 
-rw-r--r-- 1 goik fb1prof 419 Sep 23 15:44 HelloWorld.class
Êþº¾^@^@^@6^@^]
^@^F^@^O        ^@^P^@^Q^H^@^R
^@^S^@^T^G^@^U^G^@^V^A^@^F<init>^A^@^C()V^A^@^DCode^A^@^OLineNumberTable^A^@^Dmain^A^@^V(\
  [Ljava/lang/String;)V^A^@
SourceFile^A^@^OHelloWorld.java^L^@^G^@^H^G^@^W^L^@^X^@^Y^A^@^LHello, world^G^@^Z^L^@^[^@\
  ^\^A^@
HelloWorld^A^@^Pjava/lang/Object^A^@^Pjava/lang/System^A^@^Cout^A^@^ULjava/io/PrintStream;\
  ^A^@^Sjava/io/PrintStream^A^@^Gprintln^A^@^U(Ljava/lang/String;)V^@!^@^E^@^F^@^@^@^@^@^\
  B^@^A^@^G^@^H^@^A^@    ^@^@^@^]^@^A^@^A^@^@^@^E*·^@^A±^@^@^@^A^@
^@^@^@^F^@^A^@^@^@^B^@  ^@^K^@^L^@^A^@  ^@^@^@%^@^B^@^A^@^@^@   ²^@^B^R^C¶^@^D±^@^@^@^A^@
^@^@^@
^@^B^@^@^@^D^@^H^@^E^@^A^@^M^@^@^@^B^@^N
HelloWorld.java HelloWorld.class
  • Human readable (kind of 😆).

  • High abstraction level.

  • Text file

  • Machine readable instructions.

  • Non-editable (usually).

  • Binary file.

Executing byte code file
      HelloWorld.class
> java HelloWorld 
Hello, world

Remark: This executes HelloWorld.class rather than HelloWorld.java.

Prefer a Long Term Release (LTS) e.g. 17, 21, ...

  • Windows / Mac-OS: Manual Oracle or OpenJDK installation.

  • Linux: Package install

    Debian / Ubuntu Fedora / Redhat
    apt install openjdk-21-jdk
    dnf install java-21-openjdk-devel
  • IntelliJ IDEA Toolbox based installation

  • Choose Ultimate.

 installation
Alternative: Using the HdM license server

Insert address:

http://jetbrains.mi.hdm-stuttgart.de:11111

External usage requires VPN !

Image layer 1
Image layer 2
Image layer 3
Image layer 4
  • Getting started
    • ➟ Play!
  • Copy code you probably do not (yet) completely understand

  • Try to guess whats going on

  • Execute and watch the outcome

  • Add minor modifications and re-execute.

  • Don't worry: You'll get a full understanding later. (Promised! 🙄)

  1. Extending class HelloWorld
  2. Working with variables
  3. A conditional
  4. A loop