dissertation · Repository of the University of Ljubljana (University of Ljubljana) · 2023
Generics in Java and parallels with templates in C++
BOJCHEVSKI, KONSTANTIN
Cited by 0Open access
Abstract
Generics are a powerful tool in object-oriented programming languages, especially in the Java programming language. They play an important role in software development, since they enable the programmer to write typeindependent code in a type-safe way. In a nutshell, a generic Java class (or method) is a class (or method) parameterized with an arbitrary number of types. When using a generic class or method, we specify concrete values for the type parameters, effectively tailoring the code of the class or method for concrete types. Another benefit of Java generics is that type safety is enforced during compilation rather than execution. The C++ programming language has a concept parallel to Java generics; these are templates. C++ templates and Java generics are similar to one another in terms of code syntax, the provided support for parameterizing types, and the most frequent use cases. However, they are actually implemented in a significantly different way, and there are important differences in their use and background semantics. In this thesis, we will show examples for both Java generics and C++ templates. We will discuss their similarities and differences, as well as advantages and disadvantages.
Cite this paper
BOJCHEVSKI, K. (2023). Generics in Java and parallels with templates in C++. Repository of the University of Ljubljana (University of Ljubljana).
BOJCHEVSKI, KONSTANTIN. “Generics in Java and parallels with templates in C++.” Repository of the University of Ljubljana (University of Ljubljana), 2023.
BOJCHEVSKI, KONSTANTIN. 2023. “Generics in Java and parallels with templates in C++.” Repository of the University of Ljubljana (University of Ljubljana).
BOJCHEVSKI, K. (2023) ‘Generics in Java and parallels with templates in C++’, Repository of the University of Ljubljana (University of Ljubljana).
@phdthesis{bojchevski2023generics,
title = {{Generics in Java and parallels with templates in C++}},
author = {BOJCHEVSKI, KONSTANTIN},
school = {Repository of the University of Ljubljana (University of Ljubljana)},
year = {2023}
}Made from the index record. Check names, capitalisation and page numbers against the paper. Need another style? AI for Research has over 10,000.