Чашечка Java
Kanalga Telegram’da o‘tish
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
Ko'proq ko'rsatish8 291
Obunachilar
+324 soatlar
+127 kun
-4930 kun
Postlar arxiv
8 291
Java on Visual Studio Code Update – August 2021
Hi everyone, welcome to the August edition of the Visual Studio Code Java update. In this post, we are going to share some exciting updates from the SpringOne 2021 conference as well as various user experience improvements.
SpringOne 2021 Updates
When it comes to Java development, we always keep Spring developers in mind. In this year’s SpringOne conference, we shared an update on our Spring tooling support in Visual Studio Code, and showcased various Spring related features in two breakout sessions.
Spring Support on GitHub Codespaces
We are excited to share that Spring framework is fully supported on GitHub Codespaces via partnership with VMWare. This means developers can develop a Spring application seamlessly in a browser-based environment without installing anything on the local machine. Here is a quick demo of starting a Spring Boot application on Codespaces.
We had a full demo-focused session at SpringOne to talk about Spring on GitHub Codespaces. If you are interested in this session, follow the link here to watch the whole recording.
Spring Tooling on Visual Studio Code
In addition to Spring support on GitHub Codespaces, we have also delivered a session to talk about how various Spring tools are supported in Visual Studio Code in general. This includes a full demonstration of how to start a Spring Boot application from scratch as well as opening and running an existing sample project such as Spring PetClinic. We also touched upon Visual Studio Code’s rich extension selection that allows developer to deploy Spring applications to cloud directly. You can watch the complete session using this link.
Spring ecosystem is a critical part of the Java application development and we will continue to invest in this area and make sure Spring developers have an awesome experience in Visual Studio Code.
Feature Improvements
Apart from Spring updates, we have made various improvements on user experience in the latest release. To see those new features, please make sure to have the latest Expansion Pack for Java installed.
Maven Project Creation
Previously, when creating a new Maven project from the Explorer, a dialog always pops up in Visual Studio Code and asks the developer if they want to directly open the project. However, we realize in some scenarios developers might want different actions.
To address this, we have added a new setting that allows developer to customize the behavior after a Maven project is created. Depending on the option that is chosen, different actions will be triggered by Visual Studio Code.
* Interactive – Visual Studio Code will ask developer for confirmation to open the project (Default behavior)
* Open – Visual Studio Code will directly open the newly created project
* Add to Workspace – Visual Studio Code will add this project to the current workspace
New Java File Creation
“New File Contribution Point” is a new feature that came from recent release of Visual Studio Code. We have adopted this feature to make Java file creation workflow more intuitive and user-friendly
In the “File” menu of Visual Studio Code, you will see a new option called “New File…” (Note the extra dots at the end). When you click on this, Visual Studio Code will prompt you to select the type of file to add. If you select “New Java class” from the dropdown, Visual Studio Code will generate the basic Java class snippet for you and you can then al[...]
17 Sen 2021, 12:22
17 Sen 2021, ~12:29
8 291
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/
17 Sen 2021, 11:06
8 291
AWS Lambda с Java: быстро и недорого
AWS Lambda - популярная платформа для разработки serverless-функций, и как Java-разработчик мне нравится иметь возможность использовать эту платформу. Однако, есть некоторые важные моменты, о которых стоит помнить при работе с ней.
Читать: https://habr.com/ru/post/578518/?utm_campaign=578518
17 Sen 2021, 06:09
8 291
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
16 Sen 2021, 23:33
8 291
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
16 Sen 2021, 23:33
8 291
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
16 Sen 2021, 09:43
8 291
Насколько быстрее Java 17?
Решение задачи по составлению расписания турнира с разъездами (TTP) — один из вычислительных тестов в нашем наборе
Позавчера вышла Java 17 с кучей новых функций и усовершенствований. Большинство из них требуют изменения кода. Кроме производительности.Просто заменяете JDK — и получаете бесплатную прибавку производительности. Но насколько большую? Стоит ли она того? Для этого мы провели бенчмарки JDK 17, JDK 16 и JDK 11.
Читать: https://habr.com/ru/post/578300/?utm_campaign=578300
16 Sen 2021, 06:06
8 291
Набор на стажировку в Dell Technologies
Dell Technologies приглашает студентов дневного отделения технических вузов Санкт-Петербурга на оплачиваемую стажировку. На выбор есть 5 направлений: программирование на Java, C++ или Python, тестирование ПО, DevOps и администрирование.
Читать: «Набор на стажировку в Dell Technologies»
16 Sen 2021, 04:37
16 Sen 2021, ~04:49
8 291
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.
16 Sen 2021, 04:03
8 291
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
16 Sen 2021, 03:50
8 291
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=57747816 Sen 2021, 02:30
8 291
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
16 Sen 2021, 01:15
8 291
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
16 Sen 2021, 01:15
8 291
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
15 Sen 2021, 11:01
8 291
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
15 Sen 2021, 07:00
8 291
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
15 Sen 2021, 04:52
8 291
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
15 Sen 2021, 00:46
8 291
How to Convert or Print Array to String in Java? Example Tutorial
Array and String are very closely related, not just because String is a character array in most of the programming language but also with popularity - they are two of the most important data...
Read: http://www.java67.com/2014/09/how-to-convert-array-to-string-in-java-example.html
15 Sen 2021, 00:46
16 Sen 2021, ~03:31
