5 Free Courses to Crack Google Cloud Professional Data Engineer Certification Exam in 2021 - Best of Lot
Hello guys, If you are preparing for Google Cloud Professional Cloud Data Engineer certification or simply known as GCP Data Engineer exam in 2021 and looking for free online Google cloud...
Read: http://www.java67.com/2020/10/5-free-courses-to-pass-google-cloud-professional-data-engineer-certification-exam.html
Hello guys, If you are preparing for Google Cloud Professional Cloud Data Engineer certification or simply known as GCP Data Engineer exam in 2021 and looking for free online Google cloud...
Read: http://www.java67.com/2020/10/5-free-courses-to-pass-google-cloud-professional-data-engineer-certification-exam.html
Kotlin Null-Safety vs ClassLoader
Недавно я проходил собеседование и одним из вопросов, стал такой загадочный экземпляр:
"А какое главное преимущество системы типов Kotlin перед Java"?
Честно говоря, выделить какое преимущество считалось главным, оказалось неразрешимой для меня задачей: Nothing, отсутсвие Wildcard и First-Class Functions вместо Java-костыля с Functional Interface (имеется ввиду 8я версия Java) не заняли первых мест в личном топе интервьюера, который мне предложили угадать.
Оказалось что главное в Kotlin - возможность обьявить Nullable Type и Null Safety подход (Замечу, что по моему опыту собственные или библиотечные Optional или Maybe решают эту проблему, и пишутся за 10 минут на Java 7. А еще есть аннотации Nullable, позволяющие проверять поля в сompile-time. Короче, есть много способов заставить делать Null проверки в plain Java. Ну да ладно).
Но речь пойдет не о странных вопросах, связанных со вкусовыми предпочтениями интервьюеров относительно синтаксического сахара.
Дело в том, что Null Safety в Kotlin можно сломать, притом не выходя из под его безопасного купола в суровый дикий мир Java и Null-Referrences.
Как?
Long story short: ClassLoader ведет себя интересным образом при попытке загрузить статические поля классов рекурсивно ссылающиеся на классы друг-друга.
Под катом примеры кода и подробное объяснение того, как он обманывает проверки на Nullable. Я искренне надеюсь что специфические знания Java/Kotlin для статьи не нужны - я объясню все детали на ходу, и уложу расследование в 10 минут.
Начнем.
Читать: https://habr.com/ru/post/561962/?utm_campaign=561962
Недавно я проходил собеседование и одним из вопросов, стал такой загадочный экземпляр:
"А какое главное преимущество системы типов Kotlin перед Java"?
Честно говоря, выделить какое преимущество считалось главным, оказалось неразрешимой для меня задачей: Nothing, отсутсвие Wildcard и First-Class Functions вместо Java-костыля с Functional Interface (имеется ввиду 8я версия Java) не заняли первых мест в личном топе интервьюера, который мне предложили угадать.
Оказалось что главное в Kotlin - возможность обьявить Nullable Type и Null Safety подход (Замечу, что по моему опыту собственные или библиотечные Optional или Maybe решают эту проблему, и пишутся за 10 минут на Java 7. А еще есть аннотации Nullable, позволяющие проверять поля в сompile-time. Короче, есть много способов заставить делать Null проверки в plain Java. Ну да ладно).
Но речь пойдет не о странных вопросах, связанных со вкусовыми предпочтениями интервьюеров относительно синтаксического сахара.
Дело в том, что Null Safety в Kotlin можно сломать, притом не выходя из под его безопасного купола в суровый дикий мир Java и Null-Referrences.
Как?
Long story short: ClassLoader ведет себя интересным образом при попытке загрузить статические поля классов рекурсивно ссылающиеся на классы друг-друга.
Под катом примеры кода и подробное объяснение того, как он обманывает проверки на Nullable. Я искренне надеюсь что специфические знания Java/Kotlin для статьи не нужны - я объясню все детали на ходу, и уложу расследование в 10 минут.
Начнем.
Читать: https://habr.com/ru/post/561962/?utm_campaign=561962
How to use lifecycle methods in functional components in React.js? useEffect() hook Example Tutorial
Hello guys, if you have been following my blogs then you know that I have launched a new series - React for Java developers and this is the 4th article on the series. Earlier, we have seen state...
Read: http://www.java67.com/2021/09/ow-to-use-lifecycle-methods-in-functinal.html
Hello guys, if you have been following my blogs then you know that I have launched a new series - React for Java developers and this is the 4th article on the series. Earlier, we have seen state...
Read: http://www.java67.com/2021/09/ow-to-use-lifecycle-methods-in-functinal.html
What is the use of DispatcherServlet in Spring MVC? Interview Question Example
Hello guys, In today's article we are going to discuss one interesting and the important Spring MVC concept, which is also a popular Spring Interview question. How DispatcherServlet works...
Read: http://www.java67.com/2017/06/what-is-use-of-dispatcherservlet-in-spring-mvc.html
Hello guys, In today's article we are going to discuss one interesting and the important Spring MVC concept, which is also a popular Spring Interview question. How DispatcherServlet works...
Read: http://www.java67.com/2017/06/what-is-use-of-dispatcherservlet-in-spring-mvc.html
How to compare two Arrays in Java to check if they are equal - [String & Integer Array Example]
Hello guys, one of the common Programming, the day-to-date task is to compare two arrays in Java and see if they are equal to each other or not. Of course, you can't compare a String array to an...
Read: http://www.java67.com/2014/05/how-to-compare-two-arrays-in-java-string-int-example.html
Hello guys, one of the common Programming, the day-to-date task is to compare two arrays in Java and see if they are equal to each other or not. Of course, you can't compare a String array to an...
Read: http://www.java67.com/2014/05/how-to-compare-two-arrays-in-java-string-int-example.html
Top 6 Free Maven and Jenkins Online Courses for Java Programmers in 2021 [ UPDATED]
Hello Java programmers, if you want to learn Maven and Jenkins and look for free resources like free online courses, you have come to the right place. Earlier, I have shared the best Maven courses...
Read: http://www.java67.com/2018/02/6-free-maven-and-jenkins-online-courses-for-java-developers.html
Hello Java programmers, if you want to learn Maven and Jenkins and look for free resources like free online courses, you have come to the right place. Earlier, I have shared the best Maven courses...
Read: http://www.java67.com/2018/02/6-free-maven-and-jenkins-online-courses-for-java-developers.html
Fluent setter. Нарушаем конвенцию
Что будет, если возвращать в setter-методе не void, а this, т.е. использовать прием Fluent Interface?
Теперь перепишем типовой кусок кода и получим такое:
Для сравнения – как тот же код выглядит без использования приёма:
Читать: https://habr.com/ru/post/577478/?utm_campaign=577478
Что будет, если возвращать в setter-методе не void, а this, т.е. использовать прием Fluent Interface?
public class SimplePojo {
private String value;
public String getValue() {
return value;
}
public SimplePojo setValue(String value) {
this.value = value;
return this;
}
// equals, hashCode, toString
} Теперь перепишем типовой кусок кода и получим такое:
private static AssignmentGroupedActivitiesResource create() {
return new AssignmentGroupedActivitiesResource()
.setGrouping(new UserActivitiesGroupingResource()
.setAlignmentScore(1)
.setFocusScore(0)
.setAdvancedGroups(Arrays.asList(
new ProductivityGroupResource()
.setSectionName("Development")
.setColor("#2196f3")
.setSpentTime(5L),
new ProductivityGroupResource()
.setSectionName("Chat")
.setColor("#E502FA")
.setSpentTime(1L)
))
.setPeriodLong(10L)
.setTotalTrackedTime(7L)
.setIntensityScore(2));
} Для сравнения – как тот же код выглядит без использования приёма:
Читать: https://habr.com/ru/post/577478/?utm_campaign=577478
Static Class, Static Variable, Keyword, and Static Method Examples in Java - Tutorial
What is static in Java
Static in Java is related to class if a field is static means it belongs to the class, similarly static method belongs to classes and you can access both static method and...
Read: http://www.java67.com/2012/11/10-points-about-static-in-java.html
What is static in Java
Static in Java is related to class if a field is static means it belongs to the class, similarly static method belongs to classes and you can access both static method and...
Read: http://www.java67.com/2012/11/10-points-about-static-in-java.html
Advantages and Disadvantages of Encapsulation in Java
The word “Encapsulation” means that closing something like we put the main power of the tablet inside the capsule. It is a mechanism that is done to bind the data and protect it from being used by everyone.
After doing encapsulation, the variables and the data of one class cannot be used in another class and this data can be used by the member functions of the same class. Encapsulation can be achieved by adding the private specifier to the variables.
See the below example of how encapsulation can be done:
public class Encapsulation {
static class Student_Details{
private int roll_no, age ;
private String name ;
public int getroll_no() {
return roll_no ;
}
public int getage() {
return age ;
}
public String getname() {
return name ;
}
public void setroll_no(int student_roll) {
roll_no = student_roll ;
}
public void setage(int student_age) {
age = student_age ;
}
public void setname(String student_name) {
name = student_name ;
}
}
public static void main(String[] args) {
Student_Details myobj = new Student_Details() ;
myobj.setname("Rahul") ;
myobj.setage(18) ;
myobj.setroll_no(34) ;
System.out.println("The name of the student is: "+myobj.getname()) ;
System.out.println("The age of the student is: "+myobj.getage()) ;
System.out.println("The roll no of the student is: "+myobj.getroll_no()) ;
}
Advantages of Encapsulation
* Data Protection: The program runner will not be able to identify or see which methods are present in the code. Therefore he/she doesn’t get any chance to change any specific variable or data and hinder the running of the program.
* Flexibility: The code which is encapsulated looks more cleaner and flexible, and can be changed as per the needs. We can change the code read-only or write-only by getter and setter methods. This also helps in debugging the code if needed.
* Reusability: The methods can be changed and the code is reusable.
Disadvantages of Encapsulation
* Code Size: The length of the code increases drastically in the case of encapsulation as we need to provide all the methods with the specifiers.
* More Instructions: As the size of the code increases, therefore, you need to provide additional instructions for every method.
* Increased code execution: Encapsulation results in an increase in the duration of the program execution. It is because more instructions are added to the code therefore they require more time to execute.
So these were the advantages and disadvantages of encapsulation. Comment down below if you have any queries.
Read: Advantages and Disadvantages of Encapsulation in Java.
The word “Encapsulation” means that closing something like we put the main power of the tablet inside the capsule. It is a mechanism that is done to bind the data and protect it from being used by everyone.
After doing encapsulation, the variables and the data of one class cannot be used in another class and this data can be used by the member functions of the same class. Encapsulation can be achieved by adding the private specifier to the variables.
See the below example of how encapsulation can be done:
public class Encapsulation {
static class Student_Details{
private int roll_no, age ;
private String name ;
public int getroll_no() {
return roll_no ;
}
public int getage() {
return age ;
}
public String getname() {
return name ;
}
public void setroll_no(int student_roll) {
roll_no = student_roll ;
}
public void setage(int student_age) {
age = student_age ;
}
public void setname(String student_name) {
name = student_name ;
}
}
public static void main(String[] args) {
Student_Details myobj = new Student_Details() ;
myobj.setname("Rahul") ;
myobj.setage(18) ;
myobj.setroll_no(34) ;
System.out.println("The name of the student is: "+myobj.getname()) ;
System.out.println("The age of the student is: "+myobj.getage()) ;
System.out.println("The roll no of the student is: "+myobj.getroll_no()) ;
}
Advantages of Encapsulation
* Data Protection: The program runner will not be able to identify or see which methods are present in the code. Therefore he/she doesn’t get any chance to change any specific variable or data and hinder the running of the program.
* Flexibility: The code which is encapsulated looks more cleaner and flexible, and can be changed as per the needs. We can change the code read-only or write-only by getter and setter methods. This also helps in debugging the code if needed.
* Reusability: The methods can be changed and the code is reusable.
Disadvantages of Encapsulation
* Code Size: The length of the code increases drastically in the case of encapsulation as we need to provide all the methods with the specifiers.
* More Instructions: As the size of the code increases, therefore, you need to provide additional instructions for every method.
* Increased code execution: Encapsulation results in an increase in the duration of the program execution. It is because more instructions are added to the code therefore they require more time to execute.
So these were the advantages and disadvantages of encapsulation. Comment down below if you have any queries.
Read: Advantages and Disadvantages of Encapsulation in Java.
The Java Programmer
What are the Various Access Specifiers for Java Classes? - The Java Programmer
There are four types of access specifiers, Access Specifier gives two advantages: Encapsulation and the other is security.
Насколько быстрее Java 17?
Решение задачи по составлению расписания турнира с разъездами (TTP) — один из вычислительных тестов в нашем наборе
Позавчера вышла Java 17 с кучей новых функций и усовершенствований. Большинство из них требуют изменения кода. Кроме производительности.Просто заменяете JDK — и получаете бесплатную прибавку производительности. Но насколько большую? Стоит ли она того? Для этого мы провели бенчмарки JDK 17, JDK 16 и JDK 11.
Читать: https://habr.com/ru/post/578300/?utm_campaign=578300
Решение задачи по составлению расписания турнира с разъездами (TTP) — один из вычислительных тестов в нашем наборе
Позавчера вышла Java 17 с кучей новых функций и усовершенствований. Большинство из них требуют изменения кода. Кроме производительности.Просто заменяете JDK — и получаете бесплатную прибавку производительности. Но насколько большую? Стоит ли она того? Для этого мы провели бенчмарки JDK 17, JDK 16 и JDK 11.
Читать: https://habr.com/ru/post/578300/?utm_campaign=578300
How to create a custom tag in JSP? Steps and Example
You can create a custom tag in JSP either by implementing the SimpleTag interface or extending SimpleTagSupport class. Custom tags are introduced in JSP 2.0 in an effort to minimize Java code from...
Read: http://www.java67.com/2021/09/how-to-create-custom-tag-in-jsp-steps.html
You can create a custom tag in JSP either by implementing the SimpleTag interface or extending SimpleTagSupport class. Custom tags are introduced in JSP 2.0 in an effort to minimize Java code from...
Read: http://www.java67.com/2021/09/how-to-create-custom-tag-in-jsp-steps.html
10 Essential JVM Options for Java Applications [ Heap Memory, SSL, to Garbage Collection]
Hello guys, this is a brief guide of appropriate JVM options, which you will often see in production Java systems. As a Java developer, you should know what these JVM options mean, their importance,...
Read: http://www.java67.com/2016/08/10-jvm-options-for-java-production-application.html
Hello guys, this is a brief guide of appropriate JVM options, which you will often see in production Java systems. As a Java developer, you should know what these JVM options mean, their importance,...
Read: http://www.java67.com/2016/08/10-jvm-options-for-java-production-application.html
Top 5 Free Object-Oriented Programming Courses for Java Programmers in 2021 [UPDATED]
The OOP or Object Oriented Programming paradigm allows you to write a program by modeling real-world things in terms of class and object. It makes representing a real-world thing in the programming...
Read: http://www.java67.com/2018/02/5-free-object-oriented-programming-online-courses.html
The OOP or Object Oriented Programming paradigm allows you to write a program by modeling real-world things in terms of class and object. It makes representing a real-world thing in the programming...
Read: http://www.java67.com/2018/02/5-free-object-oriented-programming-online-courses.html
AWS Lambda с Java: быстро и недорого
AWS Lambda - популярная платформа для разработки serverless-функций, и как Java-разработчик мне нравится иметь возможность использовать эту платформу. Однако, есть некоторые важные моменты, о которых стоит помнить при работе с ней.
Читать: https://habr.com/ru/post/578518/?utm_campaign=578518
AWS Lambda - популярная платформа для разработки serverless-функций, и как Java-разработчик мне нравится иметь возможность использовать эту платформу. Однако, есть некоторые важные моменты, о которых стоит помнить при работе с ней.
Читать: https://habr.com/ru/post/578518/?utm_campaign=578518
Build Your Software Roadmap with QCon Plus; Kristen O’Leary shares Top Topics
During a recent interview, Kristen O'Leary, senior developer relations engineer at Google and QCon Plus November 2021 Committee Member, shared with us the tracks she is most looking forward to at the event this November 1-12.
By Adelina Turcu
Read: https://www.infoq.com/news/2021/09/qcon-plus-top-topics/
During a recent interview, Kristen O'Leary, senior developer relations engineer at Google and QCon Plus November 2021 Committee Member, shared with us the tracks she is most looking forward to at the event this November 1-12.
By Adelina Turcu
Read: https://www.infoq.com/news/2021/09/qcon-plus-top-topics/
Top 6 Free Courses to Learn Web Development in 2021 - Best of Lot
Hello guys, I have been sharing a lot of free online courses and books on various technology and programming language like Python, Java, C++, JavaScript, PHP, React, Angular, Spring in this blog for...
Read: http://www.java67.com/2018/03/top-5-free-courses-to-learn-web-development.html
Hello guys, I have been sharing a lot of free online courses and books on various technology and programming language like Python, Java, C++, JavaScript, PHP, React, Angular, Spring in this blog for...
Read: http://www.java67.com/2018/03/top-5-free-courses-to-learn-web-development.html
Asserting JDK Flight Recorder Events with JfrUnit
JfrUnit may be used to verify whether or not events occurred that impact the performance of the application such as garbage collection and memory allocation. JfrUnit makes it possible to assert events emitted from the application such as memory allocation, IO, or database queries. Custom events may be created with the JMC agent for libraries that don’t emit events themselves.
By Johan Janssen
Read: https://www.infoq.com/news/2021/09/jfrunit-flight-recorder-events/
JfrUnit may be used to verify whether or not events occurred that impact the performance of the application such as garbage collection and memory allocation. JfrUnit makes it possible to assert events emitted from the application such as memory allocation, IO, or database queries. Custom events may be created with the JMC agent for libraries that don’t emit events themselves.
By Johan Janssen
Read: https://www.infoq.com/news/2021/09/jfrunit-flight-recorder-events/
3 Ways to convert Date to LocalDate in Java 8 - Example, Tutorial
One of the great features of Java 8 is the new Date and Time API which is intended to fix existing issues related to mutability and thread-safety with existing java.util.Date class. But given...
Read: http://www.java67.com/2019/10/3-ways-to-convert-javautildate-to-LocalDate-java8-example.html
One of the great features of Java 8 is the new Date and Time API which is intended to fix existing issues related to mutability and thread-safety with existing java.util.Date class. But given...
Read: http://www.java67.com/2019/10/3-ways-to-convert-javautildate-to-LocalDate-java8-example.html
10 ways to Learn New Programming language or Tech skills in 2021?
One of the main challenges of being a programmer or software engineer is constant learning. Yes, that's true. As a programmer or developer, we always need to learn new things, sometimes every...
Read: http://www.java67.com/2017/12/10-ways-to-learn-new-technology-programming-language-or-framework.html
One of the main challenges of being a programmer or software engineer is constant learning. Yes, that's true. As a programmer or developer, we always need to learn new things, sometimes every...
Read: http://www.java67.com/2017/12/10-ways-to-learn-new-technology-programming-language-or-framework.html
Difference between IN, OUT, and INOUT parameters in JDBC Stored Procedure? Answer
Hello guys, Java Database Connectivity, the JDBC API supports three types of parameters, I mean, IN, OUT, and INOUT. They are used to bind values into SQL statements. An IN parameter is the one...
Read: http://www.java67.com/2021/09/difference-between-in-out-and-inout.html
Hello guys, Java Database Connectivity, the JDBC API supports three types of parameters, I mean, IN, OUT, and INOUT. They are used to bind values into SQL statements. An IN parameter is the one...
Read: http://www.java67.com/2021/09/difference-between-in-out-and-inout.html
Точка пересечения двух отрезков
Нахождение точки пересечения двух отрезков
Читать: https://habr.com/ru/post/578746/?utm_campaign=578746
Нахождение точки пересечения двух отрезков
Читать: https://habr.com/ru/post/578746/?utm_campaign=578746