Skip to content

Tags

#java

Java and the JVM: frameworks, build tools, memory, concurrency and modern language features.

19 posts

Posts tagged #java

  1. Article

    Mock interview breakdown: she solved it and still got "no hire". Here is the scorecard.

    Kunal and I have been doing free mock interviews on weekends this month. One of them taught me more than the others, so with the candidate's permission (and details changed) here is the full breakdown. She solved the problem. Her code was correct. In a real loop she would have got a "lean no hire". Let us see why. The question type A merge intervals variant. Medium difficulty. Nothing exotic. Minute by minute 0-3:…

    Nikhil Sharan57likes11comments

  2. Question

    Java: why == works for 127 but not for 1000;

    Hello, I am CS student in Thessaloniki, learning Java for my exam. I found something strange and my professor only said "look it up" xD Integer a = 127; Integer b = 127; System.out.println(a == b); // true Integer c = 1000; Integer d = 1000; System.out.println(c == d); // false ;; Why the same code gives different result; Is it a bug in my JDK (Temurin 21); Should I always use equals for Integer; Thank you!

    Nikos Papadakis12likes8comments

  3. Question

    do i actually need to learn C first?? frank keeps telling me to 😭

    ok so im 16, been making minecraft mods in java for like a year and i lowkey love it. but every time i post something frank_cpp98 replies "learn C first, kid" and now im scared im doing it wrong lol questions (sorry theres a lot) do i need C to get a job later or is java fine should i learn c++ instead since its closer to java?? will AI take all the jobs before i graduate anyway (fr asking) i just put linux on my…

    Max Petrosyan12likes10comments

  4. Question

    how do i convince my parents modding is not wasting time (they think its just gaming)

    ok so context im 16 and i make minecraft mods in java, ive got 2 on modrinth, one has like 3.4k downloads which is lowkey insane to me. my parents (mostly my dad) think its "just playing games" and want me to do more "real" stuff like sat prep and robotics club. i do go to school and my grades are fine (mostly As, one B in chem dont ask) but every time i say "im coding" they see minecraft on the screen and its over.…

    Max Petrosyan9likes12comments

  5. Article

    N+1 no JPA: como achei 1.201 queries numa tela de listagem (e matei com 3 linhas)

    semana passada o DBA abriu chamado: "a tela de pedidos tá derrubando o Postgres, precisamos aumentar a instância". eu fui olhar antes de alguém gastar dinheiro. a tela lista 600 pedidos com o nome do cliente e a quantidade de itens. coisa simples. liguei o log de SQL e fui pegar um café. quando voltei o terminal ainda tava rolando kkkkk como achar # application.properties logging.level.org.hibernate.SQL=debug…

    Caio Nascimento10likes10comments

  6. Question

    my minecraft mod only works when i add System.out.println. is my code haunted 💀

    ok so this is lowkey the weirdest bug ive ever had. im making a mod with a background thread that loads some stuff and the main thread waits for it to finish. works fine in my dev env but on my mates pc it just freezes forever. no crash no error nothing heres the important bits public class Loader { private boolean done = false; public void start() { new Thread(() -> { loadAllTheThings(); done = true; }).start(); }…

    Jaxon Pearce15likes12comments

  7. Experience

    5.30 am, before the tiffin boxes: relearning Java after a 7 year break (and what changed since Java 8)

    Good morning everyone. It is 5.30 am in Pune, the children are asleep, the milk has not come yet, and I have about 50 minutes. So I will write fast. Kindly excuse any mistakes. I was a Java developer at a service company until 2018. Then two children, and my father-in-law's illness, and I took a break that was supposed to be one year and became seven. Three months ago I decided to come back. Many people here have…

    Meenal Deshpande39likes9comments

  8. Question

    Returning to Java after 7 years (Java 8 to Java 21). What should I relearn first?

    Good morning all. It is 5.30 am here, the kids are not awake yet, so I am posting before the chaos starts 🙂 I was a Java developer at a service company till 2018: mostly Java 8, Spring 4 with XML configuration, and Struts on one old project (kindly do not laugh). After a seven year break I am preparing to return to work. Now I see Java 21 everywhere: records, var, sealed classes, pattern matching, virtual threads.…

    Meenal Deshpande39likes10comments

  9. Experience

    We found 22 year old bug in COBOL batch job. We kept it.

    Currently I am migrating nightly batch jobs from COBOL to Java in core banking system. Some jobs are older than some of my colleagues. Everybody wants to "modernise", which usually means somebody wants microservices. We did not do microservices. We did something boring and it saved us. One job calculates interest accrual for savings accounts. We rewrote it in Java with BigDecimal, unit tests, code review, everything…

    Tomasz Kowalski7likes4comments

  10. Article

    Log4Shell, four years later: the lesson everyone said they learned and nobody did

    Log4Shell (CVE-2021-44228, December 2021) is old news, but I keep seeing the same mistakes it should have cured, so here is the short version and what it was actually about. what happened Log4j is a Java logging library that is inside an enormous amount of the world's software. it had a feature where a logged string could trigger a lookup, and an attacker who could get a crafted string logged (a username, a user…

    Nadia Benali40likes6comments

  11. Experience

    achei um método de 4.200 linhas no sistema do banco. o nome dele é processaTudo()

    tô alocado num projeto de banco faz 4 meses (não vou dizer qual, meu contrato tem cláusula até pra respirar kkkk). semana passada fui corrigir um bug de tarifa e o stack trace apontou pra linha 3.847 de uma classe. linha 3.847. de UM método. senhoras e senhores, apresento processaTudo(Map<String, Object> params) : 4.200 linhas 37 "parâmetros", todos dentro de um Map de String pra Object. boa sorte adivinhando o tipo…

    Caio Nascimento9likes12comments

  12. Article

    Read the constraints first: how I pick the pattern in under 2 minutes

    Most people read the story in a problem and skip the constraints. The story is decoration. The constraints tell you the complexity you are allowed, and the complexity tells you the pattern. This is the routine I use, and the one I have been teaching in mocks for six years. Step 1: constraints → your budget Rough rule: a judge does about 10^8 simple operations per second in C++ or Java. So: n ≤ 20 : exponential is…

    Nikhil Sharan111likes35comments

  13. Article

    Spring Boot 2.7 to 3.3 on a European bank project: what actually broke (it was not just javax)

    Our client, a mid-size bank in Europe, got a finding from their security team: Spring Boot 2.7, open source support ended in November 2023, upgrade. So our team of 7 in Pune got the job. 41 Maven modules, Oracle database, a partner integration in Frankfurt, and a change advisory board that meets once a week. Here is what broke, in the order we found it. 0. Java 17 first, separately Boot 3 needs Java 17. We moved…

    Omkar Joshi27likes11comments

  14. Article

    Kotlin coroutines in a Spring service: three leaks we shipped and what structured concurrency fixed

    We run our routing service in Kotlin on Spring Boot. Coroutines were introduced two years ago by enthusiastic people, including me. Here are the three mistakes we made, all of them explained in the kotlinx.coroutines docs, which none of us had read properly. Hence the topic. 1. GlobalScope for fire-and-forget fun ship(order: Order) { GlobalScope.launch { auditClient.record(order.id, "shipped") }…

    Bram Verhoeven22likes9comments

  15. Question

    If I may ask: how do you use AI for COBOL to Java migration when the bank forbids internet?

    Good evening. I am sorry for my poor English. I am system engineer at an SIer in Osaka and our project is the migration of a regional bank system from COBOL to Java. About 1.8 million lines of COBOL, the oldest parts written in 1987. Many people on this site and in the news say "just use AI for legacy migration". I would like to try, but I have some conditions: The bank does not allow source code to leave the…

    Kazuhiro Yamamoto11likes12comments

  16. Article

    Monotonic stack, explained with a queue at a chai stall

    Problem: for every element in an array, find the first element to its right that is greater than it. If none, -1. Brute force: for each i, scan right until you find something bigger. O(n²). With n = 10^5 you are done for. The chai stall Imagine people standing in a line outside a chai stall, all looking to the right. Each person wants to know: who is the first person to my right who is taller than me? Walk along the…

    Nikhil Sharan37likes8comments

  17. Experience

    A normal day at a Japanese SIer, explained as politely as I can

    Good evening. Several members asked me in the comments what a "normal day" is like at a Japanese system integrator (we say SIer). I will try to explain honestly. I am sorry for my poor English and for the length. I wrote it on the train. 7:40 I take the train from my home in Sakai to the office in Umeda. It is crowded, but it is very punctual. The train is the most reliable system in my life, I think. 8:45 Chōrei…

    Kazuhiro Yamamoto13likes10comments

  18. Article

    Two pointers is not one trick. It is three shapes.

    Every week someone messages me "bhaiya two pointers samajh aata hai but question mein apply nahi hota". That happens because people learn it as one trick. It is actually three different shapes, and the problem statement tells you which shape it wants if you read it slowly. Shape 1: opposite ends, moving inward Signal: the array is sorted (or you are allowed to sort it) and you want a pair with some property. Classic…

    Nikhil Sharan19likes9comments

Get the best of Dynamo Geeks weekly

One email each Monday with the most useful posts. No spam; unsubscribe in one click.