Mert Y. Ertugrul

Greenhorn
+ Follow
since Jul 24, 2023
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mert Y. Ertugrul

Hi All,

I'm aiming to gain a comprehensive understanding of how the Java Virtual Machine (JVM) interprets bytecode and the role of the Just-In-Time (JIT) compiler in executing Java applications.

Could you recommend any books or resources that explain these processes in a clear and concise manner?
4 months ago
Hi everyone,

I am very happy to share that I have passed the OCP Java SE 17 1Z0-829 exam today and I want to share my journey with you all.

I have been working as a software engineer for more than five years now, handling different tech stacks like MS SQL Server, Python, MongoDB, and JavaScript with various frameworks, as well as Java. I've maintained legacy applications, worked on new projects, and managed teams. Despite my practical experience with Java, I always wanted to delve deeper and pass the certification exam. However, I never found the time until last year when I decided to prioritize this goal.

When I first started learning Java, the Java 8 certification was relatively new, and many companies, including mine, were discussing migration to Java 8. I still have Boyarsky and Selikoff's Java SE 8 Study Guide in my library. I remember reading only two chapters before finding a job and setting the book aside.

To prepare for the Java 17 certification, I bought Boyarsky and Selikoff's latest study guide. My first read-through took some time, and I struggled with solving questions without referring to my notes. This was frustrating because, despite being a professional software developer, I was making mistakes on fundamental topics. Nevertheless, I persisted, reading the entire book at least three times, with some chapters revisited four or five times, and solving every question multiple times.

Enthuware was instrumental in my preparation. I solved all their questions but noticed I still couldn't pass the mock exams, and some questions seemed very similar. I decided to use my Java skills to create a question database with a Spring Boot application and a front-end. This allowed me to tag, rate, take notes, and create different quizzes. I also scraped all Enthuware open questions with Selenium, as well as those from Boyarsky and Selikoff's book, and added them to my database. This approach significantly helped me study each subject thoroughly. I plan to release the app on iOS (without the my scrapped question database, it is create your own question bank application) in the future but there a a lot of unfinished tasks. I am open to collaborations if anyone is interested.

Learning Java, like any skill, takes time and shouldn't be rushed. There might be thousands of rules, many with exceptions, and even exceptions to the exceptions. For the first time, I used flashcards to memorize these rules, and I regret not using this effective learning technique earlier.

Regarding the exam, it was online, which was very convenient. Before starting, I asked if I could use pen and paper, and they agreed. I also asked if I could take a quick bathroom break, and they said yes, as long as I didn't turn off my camera.

The questions were very similar to those in Enthuware, which was reassuring. I am immensely grateful to the creators of the Enthuware question bank. One question was almost identical to one I had solved recently, involving the Bitwise operator, about:



However, I did get stuck on one question about binarySearch in collections. I thought performing binarySearch on an unsorted list would yield unpredictable results, but none of the answer have the option.

I also want to extend my gratitude to everyone who answered my stupid questions on the CodeRanch forum.

Thank you for reading my story, I hope it helps.

Best regards,
Mert
9 months ago
I think I should give more context. Imagine this example:


The Eatable interface defines a field types, which is coderanch, static, and final. The Food class implements the Eatable interface and hides the types variable with a different value. The Fruit class extends the Food class, and now the Fruit class has access to both types variables using the class name. If no class name is used, the direct superclass will be used. This is all fine.

Now, what if the Fruit class extends Food and also implements Eatable? This makes multiple inheritance possible, and things get interesting.



Now, if types is used inside the Fruit class without specifying the superclass or interface name, it does not compile because of ambiguity.

This example confused me and made me realize that I should dive deeper into this concept.
9 months ago
Hi,

Even though I've read about it from different resources, I still can't grasp the concept of variable hiding in interfaces. I think I need to understand how variable hiding work at the compiler level.

Can anyone recommend a good resource that explains this concept thoroughly?
9 months ago
Hi,

I have been writing Java using packages for years now, and it has worked very well. However, ever since I started training for the OCP, I've read a lot about Java Modules, and now I'm starting to think I might be missing out on a valuable feature of Java.

Let's say we have a simple API with these packages:
  • model
  • repository
  • service
  • controller


  • Do you think it is a good idea to create separate modules for each package? Additionally, since I like using Gradle or Maven, do they work well with Java Module feature?

    What do you guys think about this?

    1 year ago
    Good eye Ira, you are right, it is an important point.

    I summarise the order like this:

  • 1. Static Variables and Static Blocks of Super-class (in the order they appear in the class).
  • 2. Static Variables and Static Blocks of Sub-class (in the order they appear in the class).
  • 3. Main Method is called (begins execution).
  • 4. Instance Variables and Instance Initializer Blocks of Super-class (in the order they appear in the class).
  • 5. Constructor of Super-class.
  • 6. Instance Variables and Instance Initialiser Blocks of Sub-class (in the order they appear in the class).
  • 7. Constructor of Sub-class.
  • 1 year ago
    Thanks, Mike, this is exactly what I am looking for.

    I also wrote this code to understand how it works, if anyone is interested



    1. Initializing static variable in Superclass
    2. Static block in Superclass
    3. Initializing static variable in Subclass
    4. Static block in Subclass
    5. Main method starts
    6. Initializing instance variable in Superclass
    7. Instance initializer block in Superclass
    8. Constructor in Superclass
    9. Initializing instance variable in Subclass
    10. Instance initializer block in Subclass
    11. Constructor in Subclass
    12. Main method ends

    1 year ago
    Hello,

    I am currently studying for the OCP Java 17 exam, and I answered the following question incorrectly:


    Question: What is printed by the following program?

    A: 182640
    B: 182943
    C: 182493
    D: 421389
    E: The code does not compile.
    F: The output cannot be determined until runtime.



    The right answer to this question is 182493. Which I think it was a fairly easy question.

    However, it's clear I do not fully understand how the compiler sets the order of initialization.

    Could anyone please point me to specific sections or topics in Java textbooks or official documentation that detail these concepts? I'm looking for resources that could help clarify the rules and execution order for class and object initialization, especially in the context of inheritance.

    Thank you in advance for your guidance and assistance!
    1 year ago
    This is my second time shh 🤫
    See you tomorrow.
    1 year ago
    Hi Simon,

    I would love to join your course, but I do not have a O'reilly account right now.

    1 year ago
    It would be much easier if Java was able to use Reification to handle Generics rather than Type Erasure though.
    1 year ago
    Thanks Paul, this is exactly what I was looking for.

    Shame on me not knowing this resource earlier.
    1 year ago