[VV99] New Java 21 Certification, Java overloading, Schema Registry. Do you do PR?, Reading mind in eyes TEST
[VV99] The Java Fullstack Newsletter

[VV99] New Java 21 Certification, Java overloading, Schema Registry. Do you do PR?, Reading mind in eyes TEST

????? NEW JAVA CERTIFICATION: Java SE 21 Developer Professional

Exam Number: 1Z0-830

Oracle released a new Java certification exam targeting Java 21.

Note the presence of this new exam objective about virtual threads:

Managing Concurrent Code Execution

* Create both platform and virtual threads:

- Use both Runnable and Callable objects,

- manage the thread lifecycle, and

- use different Executor services and concurrent API to run tasks.

* Develop thread-safe code, using locking mechanisms and concurrent API.

* Process Java collections concurrently and utilize parallel streams.

#ocp #java #certification #java21

https://education.oracle.com/java-se-21-developer-professional/pexam_1Z0-830




???JAVA CERTIFICATION QUESTION: overloading

Given:

package com.vv;

import java.time.LocalDate;

public class FetchService {

    public static void main( String[] args ) throws Exception {
        FetchService service = new FetchService();
        String ack = service.fetch();
        LocalDate date = service.fetch();
        System.out.println( ack + " the " + date.toString() );
    }

    public String fetch() {
        return "ok";
    }

    public LocalDate fetch() {
        return LocalDate.now();
    }
}        

What will be the output?

* ok the 2024-07-10

* ok the 2024-07-10T07:17:45.523939600

* An exception is thrown

* Compilation fails

#java #certificationquestion #ocp

https://www.udemy.com/course/ocp-oracle-certified-professional-java-developer-prep/?referralCode=54114F9AD41F127CB99A

Compilation fails because

'fetch()' clashes with 'fetch()'; both methods have same erasure

'fetch()' is already defined in 'com.vv.FetchService'

The provided code will result in a compilation failure.

The reason is that the FetchService class has two methods named fetch with the same parameter list (i.e., no parameters).

In Java, method overloading requires the methods to have different parameter lists.

Since both fetch methods have identical signatures, this is not allowed.

Here is the problematic part of the code:

public String fetch() {
    return "ok";
}
public LocalDate fetch() {
    return LocalDate.now();
}        

These two methods have the same name and parameter list, which leads to a compile-time error due to method signature conflict.

Therefore, the correct answer is:

Compilation fails

Official Oracle tutorial: Overloading Methods

The Java programming language supports overloading methods, and Java can distinguish between methods with different method signatures.

This means that methods within a class can have the same name if they have different parameter lists (there are some qualifications to this that will be discussed in the lesson titled "Interfaces and Inheritance").

https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html




??? QUOTE

To truly learn, you need to practice and gain experience beyond just reading or watching classes.



Understanding Kafka (I mean Confluent) Schema Registry ??

  1. What is Kafka (I mean Confluent) Schema Registry? ??
  2. Is it mandatory to use Kafka?
  3. Position in Kafka Architecture ???
  4. Advantages ??
  5. Disadvantages ??
  6. Conclusion ??

Key Takeaways ??

Kafka Schema Registry is a powerful tool for managing data schemas in a Kafka-based architecture. While it introduces some complexity and performance overhead, its benefits in ensuring data consistency, versioning, and interoperability make it a valuable component in many data-driven applications.

Overview of the different formats used with Kafka Schema Registry:

  • Avro ??

Avro: Compact, fast, supports complex types, includes schema with data.

  • Protobuf ??

Protobuf: Efficient, supports multiple languages, schema not included with data.

  • JSON Schema ??

JSON Schema: Human-readable, easy to debug, less compact.

#kafka #schema #registry

Clemens said:

The Apache Kafka project has no schema registry. You appear to be referring to a proprietary, shared source product component of the Confluent platform.

I replied:

Thank you for pointing that out! You're right, Apache Kafka doesn't include a built-in schema registry. I was referring to the Confluent Schema Registry. For those not using Confluent, alternatives like Karapace or Redpanda are available. Thanks again! Best regards,

Sarwar shares this idea:

Schema registry doesn't validate your data or schema changes. It checks schema compatibility via clients' serializers or deserializers, but clients can bypass this. Kafka doesn’t enforce data validation, lacking a broker-end interceptor. Confluent Server only verifies schema ID validity, not the data itself.



POLL: Do you use Pull Requests in your team? YES/ NO

Most of us do PR

According to Java champion Gunnar Morling: "Pull requests are great for low-trust environments like OSS with many external contributors. For stable teams e.g. in-house, I feel that they are too wasteful of a process and slow. Make sure to have alignment on the big picture, anything else can also be improved after merging"

#coding #pull #request #java #programming

Twitter link of Gunnar Morling's statement: https://lnkd.in/e5uPwkiu




Soft skills: ??Are you good at reading the mind in the eyes? TEST YOU??

For each set of eyes, choose which word best describes what the person in the picture is thinking or feeling. You may feel that more than one word is applicable, so choose the word which you consider to be the most suitable. Before making your choice, make sure that you have read all four words. Try to do the task as quickly as possible, but you will not be timed.




?? JOKE: Git merge of an old branch ???

git merge


要查看或添加评论,请登录

Vincent Vauban的更多文章

  • [VV113] The Java 21 Newsletter

    [VV113] The Java 21 Newsletter

    ????2??1?? Dear followers, let's prepare for Java 21 certification together! 1?? How would you answer this question:…

  • ?? Broken Function Level Authorization – API5:2023 ??

    ?? Broken Function Level Authorization – API5:2023 ??

    I'm kicking off a series of articles on API Security ?? to help us—developers ????????—better understand and implement…

  • [VV112] The Java 21 Newsletter

    [VV112] The Java 21 Newsletter

    ????2??1?? Dear followers, let's prepare for Java 21 certification together! 1?? How would you answer this question:…

  • FR Les mots sans les maux. ???

    FR Les mots sans les maux. ???

    FR Hier, j’ai eu la chance d’assister à un atelier sur la Communication Non Violente (CNV) avec les superbes people de…

  • ?? Unrestricted Resource Consumption – API4:2023 ??

    ?? Unrestricted Resource Consumption – API4:2023 ??

    I'm kicking off a series of articles on API Security ?? to help us—developers ????????—better understand and implement…

  • ?? Broken Object Property Level Authorization – API3:2023 ??

    ?? Broken Object Property Level Authorization – API3:2023 ??

    I'm kicking off a series of articles on API Security ?? to help us—developers ????????—better understand and implement…

  • [VV111] The Java 21 Newsletter

    [VV111] The Java 21 Newsletter

    ????2??1?? Dear followers, let's prepare for Java 21 certification together! 1?? How would you answer this question:…

    18 条评论
  • ?? Broken Authentication – API2:2023 ??

    ?? Broken Authentication – API2:2023 ??

    I'm kicking off a series of articles on API Security ?? to help us—developers ????????—better understand and implement…

  • ?? BOLA – The #1 API Security Threat (API1:2023)

    ?? BOLA – The #1 API Security Threat (API1:2023)

    I'm kicking off a series of articles on API Security ?? to help us—developers ??????????—better understand and…

  • [VV110] The Java 21 Newsletter

    [VV110] The Java 21 Newsletter

    ????2??1?? Dear followers, let's prepare for Java 21 certification together! 1?? How would you answer this question:…

社区洞察

其他会员也浏览了