ADC With Mounir (@ADCWithMounir) header
ADC With Mounir (@ADCWithMounir) profile picture

Architect → Design → Code. The full journey of a Java engineer. YouTube https://nitter.gq/t.co/AZ4ghe5SNN GitHub https://nitter.gq/t.co/5tRtWJlH0z

Paris, Ile-de-France
Joined September 2026
Photo by ADC With Mounir (@ADCWithMounir)Photo by ADC With Mounir (@ADCWithMounir)Photo by ADC With Mounir (@ADCWithMounir)Photo by ADC With Mounir (@ADCWithMounir)Photo by ADC With Mounir (@ADCWithMounir)Photo by ADC With Mounir (@ADCWithMounir)Photo by ADC With Mounir (@ADCWithMounir)Photo by ADC With Mounir (@ADCWithMounir)Photo by ADC With Mounir (@ADCWithMounir)Photo by ADC With Mounir (@ADCWithMounir)
Two predicates in your code. You need three more combinations. You don't write a single new rule.
2
Four lambdas for one Predicate. Only one compiles. Answer in the replies in one hour.
1
4
Answer: C (var m) is a legal single parameter, and m.hd() returns the boolean. A: braces need return and a semicolon. B: test() takes one parameter, and the styles are mixed. D: a typed parameter needs parentheses. Full explanation on my YouTube channel.
5
A third ride type joins the enum. Everything compiles. The six-seat van now shows up as a Comfort car with four seats. How would you close the menu? Your fix in the replies.
1
4
The fix: replace the type code with an interface. RideOption gives label, seats and fare. Economy, Comfort and Xl each implement it. The menu just asks every option. A new ride type is now a new class. The menu never changes.
2
Three objects. The static block runs once.
6
Two classes, static and instance blocks, two new Series(). What does it print? Answer in the replies in one hour.
1
7
Answer: B (ADBCEFBCEF) The classes are set up first, parent first: A then D, and only once. Each new Series builds the Content part (B, C), then the Series part (E, F). The second object skips A and D. Full explanation on my YouTube channel.
Validate a record without rewriting its constructor. The compact constructor runs in 3 steps.
5
A static field, a private field, and a compact constructor. Which lines break this record? Answer in the replies in one hour.
1
1
21
Answer: C (lines 3 and 6) Line 2 is fine: records can have static fields. Line 3: no instance field in a record body, even private. Line 6: this.title is final, a compact constructor can't assign it. Write title = title.strip(); Full explanation on my YouTube channel.
5
A TreeSet of records. It compiles, then fails on the very first add. Your fix in the replies.
1
1
35
The fix: make Show implement Comparable<Show>, or give the set a Comparator: new TreeSet<>(Comparator.comparing(Show::title)) A TreeSet must compare elements to sort them. Without a way to compare, it throws ClassCastException.
1
12
Lambdas, functional interfaces, method references, java.util.function, helpers and the variable rule. All of functional programming in Java fits on one page.
2
61
Every team starts fast. A year later, every change breaks two other things. The cause is rarely the deadline. It's the mess we promised to clean "later". And later equals never. #CleanCode #Java #Programming Clean Code in Java, episode 1/16: youtu.be/vUTNmloVt8g
1
51
Your notifier sends SMS. Now product wants push notifications. If the notifier has to change, the design is missing one thing.
1
72
The instance block is the first thing in this class. It still runs after both static blocks. new Player() prints 0-5-HD-play-.
1
26
A record constructor that rejects bad data. It doesn't compile. Your fix in the replies.
1
1
13
The fix: add this.minutes = minutes; Writing the full constructor of a record replaces the generated one, and every final field must be assigned. Better: a compact constructor, Movie { ... }, and Java assigns the fields for you.
68