Taller 7 introduces access modifiers — the mechanism Java uses to control which parts of your code can access class members. Starting from a simple employee model with mixedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Jhaymayleth/unidad2_java/llms.txt
Use this file to discover all available pages before exploring further.
public and private fields, the exercises progress through a fully encapsulated bank account and conclude with a stateless utility class whose methods never require an object instance.
Exercises
Ejercicio 1 — Empleado
Explore
public vs private fields, the getter/setter pattern, and salary validation logic in a concrete employee model.Ejercicio 2 — CuentaBancaria
Protect sensitive financial data with
private fields, validated deposit and withdrawal methods, and peer-to-peer transfers.Ejercicio 3 — Utilidades
Build a static utility class whose arithmetic, rounding, prime-checking, and factorial methods need no instantiation.
Key Concepts Covered
| Concept | Description |
|---|---|
public | Members accessible from any class |
private | Members accessible only within the declaring class |
| Getter / Setter pattern | Controlled read and write access to private fields |
| Input validation | Setters and operation methods reject invalid data before mutating state |
static methods | Utility methods that belong to the class, not to any instance |