Чашечка Java – Telegram
Чашечка Java
8.86K subscribers
3.86K photos
12 videos
56 files
6.32K links
Лучшие материалы по Java на русском и английском

Разместить рекламу: @tproger_sales_bot

Правила общения: https://tprg.ru/rules

Другие каналы: @tproger_channels
Download Telegram
Что должен знать Java Software Engineer

Есть много разных понятий для человека, который занимается программированием: кодер, разработчик, программист и т.д. Мне же больше по душе такое понятие, как инженер-программист или software engineer, т.к. данное понятие охватывает наибольшее количество тем и направлений, необходимых для разработки. Это лично моё виденье.

Так чем же принципиально software engineer отличается от остальных регалий? Ответ достаточно прост и очевиден - набором знаний о технологиях и большим кругозором в сфере, которой он себя посветил. Кроме того, сталкиваясь с какой-либо проблемой или задачей, он уже понимает какой подход нужен для её решения, или знает, что надо "подтянуть", чтобы быть компетентным в данном вопросе.

Т.к. на данный момент мой основной язык программирования Java, то и рассматривать данный вопрос я буду со стороны Java. Однако общая концепция хорошо ложится на другие языки с небольшой корректировкой "под себя".

Цель статьи привести - познакомить читателя с предлагаемым мною набором знаний. Ниже я привожу набор направлений и технологий, которыми должен обладать с теоретической и практической точки зрения software engineer.


Читать: https://habr.com/ru/post/577888/?utm_campaign=577888
Вышла Java 17

Вышла общедоступная версия Java 17. В этот релиз попало более 2700 закрытых задач и 14 JEP'ов. Изменения API можно посмотреть по этой ссылке.

Читать: https://habr.com/ru/post/577924/?utm_campaign=577924
Java 17, the Next Long-Term Support Release, is Now Available

Oracle has released version 17 of the Java programming language and virtual machine. As the first long-term support release since JDK 11 in 2018, the final feature set includes 14 JEPs. Two of these, JEP 403 and JEP 411, generated some concerns within the Java community.
By Michael Redlich

Read: https://www.infoq.com/news/2021/09/java17-released/
Защищаем свой код от багов: обзор пяти статических анализаторов для Java-кода

Статические анализаторы могут найти и исправить проблемный код Кратко рассмотрим популярные статические анализаторы для Java-кода.

Читать: «Защищаем свой код от багов: обзор пяти статических анализаторов для Java-кода»
Java снова бесплатна

Тезисно:

Java 17 полна решимости пробить барьер, имеющийся на границе Java 8 и Java 9. Теперь, начиная с 17-ой версии, Oracle будет предоставлять Oracle JDK бесплатно, даже для коммерческих целей. Единственное чего делать нельзя — это перепродавать Oracle JDK.

В статье приведен перевод полного текста анонса с блога Oracle.

Читать: https://habr.com/ru/post/577966/?utm_campaign=577966
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
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
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
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
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
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
Fluent setter. Нарушаем конвенцию

Что будет, если возвращать в 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
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.
Насколько быстрее Java 17?

Решение задачи по составлению расписания турнира с разъездами (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
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
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
AWS Lambda с Java: быстро и недорого

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/
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