ADVANCED PROGRAMMING
3° Year of course - Second semester
Frequency Not mandatory
- 9 CFU
- 72 hours
- Italian
- Trieste
- Obbligatoria
- Standard teaching
- Oral Exam
- SSD ING-INF/05
Knowledge and understanding.
- Know what object-oriented programming is: how to store, process, and access data with objects.
- Know the syntax and the features of the Java programming language and of the Java software platform.
- Know the style conventions for Java language.
- Know Java main frameworks and APIs.
- Know the common structure of the basic development tools, including those for unit testing.
- Understand how a Java program is executed by a computer.
Applying knowledge and understanding.
- Design, develop, test, and debug complex software in Java.
- Model concepts and procedures with Java.
Making judgements.
- Decide if Java fits a given programming task.
- Judge the quality of a software written in Java in terms of code style, software artifacts structure, testing, and documentation.
Communication skills.
- Describe the motivations behind choices in the design and development of a software written in Java.
- Comprehend, formulate, and describe the specifications for a software.
Learning skills.
- Learn, through software documentation and examples, to use any software written in Java.
- Learn the basics of other object-oriented programming languages.
- Basics of programming and data structures: algorithm, data types, loops, recursion, parallel execution.
- Basics of computer networks: IP, TCP.
What is Java
Main concepts of object-oriented programming
Packages and more concepts
Basic input/output (I/O); program flow; basic operations
Java code style
Inheritance and polymorphism
Inheritance and extends keyword
Parameter passing; visibility and lifetime
JVM memory: stack and heap
I/O streams; accessing file system; I/O of bytes and primitive data types
Basic exceptions handling; try, catch, and finally keywords
Concurrent execution
Packing and documenting code
Interfaces and abstract classes
Collections framework: Collection interface and its main methods
Recent/advanced Java (language and API) features
Teacher’s slides, freely available online (on teacher's website: https://medvet.inginf.units.it/teaching/), in English.
What is Java
Programming language vs. software platform
Compilation and execution of a Java program
Java Virtual Machine (JVM), Java Runtime Environment, Java Development Kit
javadoc: using the documentation
Integrated Development Environment (IDE); the online option
Main concepts of object-oriented programming
Object and reference
Graphical notation for objects and references during execution
Class and primitive data type; object as instance of class
Method and signature; overloading of methods; dot operator; naming conventions for classes and methods names
Constructor
Modularity and information hiding
Field
Identifiers and visibility; private and public visibility modifiers
this identifier
Packages and more concepts
Package; package name; Application Program Interface (API) as package set; fully qualified name; naming conventions for packages
import keyword; import of packages; where classes are looked for
static modifier
Arrays
main() method
Basic input/output (I/O); program flow; basic operations
Program flow: conditional execution and looping with if, for, while, etc.
Command line parameters; reading from standard input; writing on standard output
String class
Assignment operator; literals and primitive data types
Development with an IDE
Java code style
Autocompletion and assisted coding
Building and debugging
Understanding error messages
Inheritance and polymorphism
Inheritance and extends keyword
Constructor of derived classes and super identifier
Polymorphism; downcasting
toString(), equals(), and ==
Parameter passing; visibility and lifetime
Parameter passing for primitive and non primitive types
Identifier visibility
Lifetime of objects and values
JVM memory: stack and heap
Wrapper classes; autoboxing/unboxing
Garbage collector
Communication
I/O streams; accessing file system; I/O of bytes and primitive data types
Basic exceptions handling; try, catch, and finally keywords
Buffered I/O streams
Writer and Reader; buffered versions
Basic network I/O with Socket and ServerSocket
Concurrent execution
Threads and Thread class; JVM memory management with threads
Multithreaded network I/O
Thread scheduling; synchronized keyword
Robust multithreaded network I/O
Exception handling
Convention: normal and abnormal execution flow
Throwing exceptions; throws keyword; RuntimeException
Handling exceptions
Packing and documenting code
Class loading; static and dynamic consistency checks
Packages: sources and compiled classes location
Documentation with javadoc: syntax and procedure
Interfaces and abstract classes
Definition and implements keyword
Inheritance of interfaces; multiple inheritance
Abstract classes and abstract keyword
Enumerations
Definition, usage, and enum keyword
Generics
Need for generic types
Syntax; typing and inheritance of typed classes (subtyping)
Wildcard; typing of methods
Collections
Collections framework: Collection interface and its main methods
Iteration over collections
Main collections; Map interface
Read/Write access time, sorting, multithreading, eviction of items; nested collections for data structuring
Recent/advanced Java (language and API) features
Executors; Future
Varargs
Default and static interface methods
Annotations
Stream API
Lambdas; functional interfaces
try-with-resources and multi catch
switch expressions
Records
Advanced development and tools
Basic build automation and dependencies management with maven
Approx 75% of lecture time: frontal lectures with blackboard and slide projection.
The remaining 25%: exercises, under teacher’s supervision, consisting in solving simple tasks of software design and development in Java.
The exam works in one of the following ways:
1. Two parts: project + oral exam. The exam is passed only if the grade is >6/10 on each part. The overall grade is the mean of the two grades.
2. Oral exam only.
Overall grades corresponding to failed exams (with the exception of project missed deadlines) will be registered as failed. The student may ask to repeat an exam also when passed: acceptance and specific parts to be repeated will be agreed with the teacher.
Exam parts and specific instructions:
- Project. At the end of the course, a project will be assigned that consists in the design and development of a software in Java following the provided specifications. The student will be required to submit the software within a deadline corresponding to the day of the written test she/he plans to apply. The evaluation will be as follows: 0/10 not submitted (missed deadline); 5/10 to 10/10 submitted, depending on quality of code, software structure, degree of working.
- Oral exam. Questions on the key concepts presented during the lectures and practical exercises of programming and modeling to be solved at the blackboard. The mean duration of an oral exam is 25 minutes.
In any type of content produced by the student for admission to or participation in an exam (projects, reports, exercises, tests), the use of Large Language Model tools (such as ChatGPT and the like) must be explicitly declared. This requirement must be met even in the case of partial use.
Regardless of the method of assessment, the teacher reserves the right to further investigate the student's actual contribution with an oral exam for any type of content produced.
This course explores topics closely related to one or more goals of the United Nations 2030 Agenda for Sustainable Development (SDGs)