Чашечка Java
前往频道在 Telegram
Лучшие материалы по Java на русском и английском Разместить рекламу: @tproger_sales_bot Правила общения: https://tprg.ru/rules Другие каналы: @tproger_channels
显示更多8 543
订阅者
-124 小时
-67 天
-3030 天
帖子存档
8 543
Top 5 courses to learn Blockchain technology in 2022 - Best of Lot
Hello guys, If you're involved in the cryptocurrency space, then you've probably heard about Blockchain. Unless you're living under a rock…
I'm talking about this new technology...
Read: http://www.java67.com/2021/12/top-5-courses-to-learn-blockchain.html
8 543
Top 5 JavaScript Data Structure and Algorithm Courses for Beginners to Learn in 2022 - Best of Lot
Hello guys, if you are a JavaScript developer learning Data Structure and Algorithms and looking for the best online course to learn Algorithms and Data Structure in JavaScript, then you have come to...
Read: http://www.java67.com/2020/09/top-5-courses-to-learn-data-structures-algorithms-in-javascript.html
8 543
Top 5 Design Patterns Books for Java Developers - Best of Lot
Design patterns are an essential topic for object-oriented programmers, like Java and C++ developers. It becomes even more important as your experience grows because everybody starts expecting a lot...
Read: http://www.java67.com/2016/10/top-5-object-oriented-analysis-and-design-patterns-book-java.html
8 543
Создание Native Images со Spring Native и GraalVM
В этой статье я хочу исследовать возможности технологии Java Native Image, поделиться опытом взаимодействия с ней и со средствами Spring для генерации нативных образов.
Читать: https://habr.com/ru/post/598753/?utm_campaign=598753
8 543
Top 5 Free & Paid Spring Certification Courses and Practice Tests
Many Java developers don't know that, similar to Oracle's Java certification, there is also a Spring certification program, which certifies yourself for your Spring framework skill. There are...
Read: http://www.java67.com/2017/08/3-free-spring-certification-mock-exams-practice-questions.html
8 543
Top 5 Web Development Courses for Beginners to Learn Online in 2022 - Best of Lot
Hello guys, web development is one of the most lucrative fields of Software development, and demand for web developers is always increasing. It's also one of the exciting fields as you create...
Read: http://www.java67.com/2021/11/top-5-web-development-courses-for.html
8 543
e3 {
public static void main(String[] args) {
MethodOverloading obj=new MethodOverloading();
obj.blogdetails(1000, "The number of People who have checked this blog are ");
obj.blogdetails( "The number of People who have checked this blog are ",1000);
}
}
Output:
The number of People who have checked this blog are 1000
The number of People who have checked this blog are 1000
Code Explanation:
We have taken two classes in the above code. The first-class name is MethodOverloading and another one is Example3 which is containing the main method.
In the MethodOverloading class, we have created two functions with blogdetails as their names and void as return type but the sequence of the parameters are different.
In the Example3 class, we have defined the main method and inside it, we have created an object of MethodOverloading class. This object is calling both the functions one by one and checks whether they are executing correctly or not.
Conclusion
Method Overloading in java can help you align your code in a much better way. You can also remember that overloading of the main method is possible in java. I hope you were able to understand this blog thoroughly. Please feel free to comment with your doubts.
Read: Method Overloading in Java With Example.
8 543
Method Overloading in Java With Example
Method overloading states that we can have methods with the same name but something in their parameters should be different. If you know about constructor overloading then it is pretty similar to method overloading.
Method overloading helps us from writing the same methods under different names. For example, a method involving multiplication of 2 numbers can be named as mymultiplication(int x, int y) and the method involving multiplication of 3 numbers can have the same name with different parameters as mymultiplication(int x, int y, int z).
If method overloading would not be supported in java then we needed to create different names of methods with a different number of parameters. Taking the above example only will result in mymultiplication(int x, int y) and mymultiplication1(int x, int y, int z) methods. This can be a little confusing while understanding another person’s program.
Ways to Achieve Method Overloading in Java
1. By Changing the Number of Parameters
class MethodOverloading{
int multiply(int x,int y) {
int res=x*y;
return res;
}
// Overloaded method with an extra parameter
int multiply(int x,int y,int z) {
int res=x*y*z;
return res;
}
}
public class Example1 {
public static void main(String[] args) {
MethodOverloading obj=new MethodOverloading();
int res_two_numbers=obj.multiply(4, 5);
int res_three_numbers=obj.multiply(2, 2,3);
System.out.println("The result of multiplication between 4 and 5 is "+res_two_numbers);
System.out.println("The result of multiplication between 2, 2 and 3 is "+res_three_numbers);
}
}
Output:
The result of multiplication between 4 and 5 is 20
The result of multiplication between 2, 2 and 3 is 12
Code Explanation:
We have taken two classes in the above code. The first-class name is MethodOverloading and another one is Example1 which is containing the main method.
In the MethodOverloading class, we have created two functions with multiply as their names and integer as return type but with different parameters. This process is known as Method Overloading in Java.
In the Example1 class, we have defined the main method and inside it, we have created an object of MethodOverloading class. This object is calling both the functions one by one and checks whether they are executing correctly or not.
2. By Changing Datatype of Parameters
class MethodOverloading{
void totalmarks(int x,int y) {
int res=x+y;
System.out.println("The total marks of the student is "+res);
}
// Overloaded method with change in datatype of parameters
void totalmarks(double x,double y) {
double res=x+y;
System.out.println("The total marks of the student is "+res);
}
}
public class Example2 {
public static void main(String[] args) {
MethodOverloading obj=new MethodOverloading();
obj.totalmarks(45, 20);
obj.totalmarks(55.6, 25.8);
}
}
Output:
The total marks of the student is 65
The total marks of the student is 81.4
Code Explanation:
We have taken two classes in the above code. The first-class name is MethodOverloading and another one is Example2 which is containing the main method.
In the MethodOverloading class, we have created two functions with totalmarks as their names and void as return type but the data types of the parameters are different.
In the Example2 class, we have defined the main method and inside it, we have created an object of MethodOverloading class. This object is calling both the functions one by one and checks whether they are executing correctly or not.
3. By Changing Sequence of Parameters
class MethodOverloading{
void blogdetails(int x,String s) {
System.out.println(s+x);
}
// Overloaded method with change in order of parameters
void blogdetails(String s, int x) {
System.out.println(s+x);
}
}
public class Exampl[...]
8 543
10 Best Web Development Courses and Projects on Coursera Plus to Join in 2022
Hello guys, if you are looking for the best web development courses and projects on Coursera to join in 2022, then you have come to the right place. Earlier, I have shared the best Coursera...
Read: http://www.java67.com/2021/12/best-coursera-plus-courses-for-web-development.html
8 543
End Of Year Learnings From Minecraft’s Migration To JDK 16 And Q&A With The Mojang Team
In an effort to obtain a smoother transition towards JDK 17, Minecraft decided to upgrade to JDK 16 first just months before Java's LTS release in September 2021. The changes point towards possible performance gains just by running JDK 17 out-of-the-box. InfoQ reached out to the Mojang team for further questions on their experience running JDK 16 in production.
By Olimpiu Pop
Read: https://www.infoq.com/news/2021/12/minecrafts-jdk16-migration/
8 543
Top 21 Websites to Learn Coding and Development for FREE in 2022 - Best of Lot
Hello folks, if you want to learn Coding from scratch and looking for some free online training websites or are someone who is learning programming and Coding by yourself and looking for some...
Read: http://www.java67.com/2018/06/21-websites-to-learn-how-to-code-for.html
8 543
Разрушаем и подтверждаем мифы о кадровых агентствах в ИТ
Всем привет! На связи Антон Чимин. Не так давно я стал ИТ рекрутером и сегодня решил написать небольшую статью о том, что на самом деле происходит внутри кадровых агентств и стоит ли с ними работать. Называть свое кадровое агентство я не буду, чтобы это не было рекламой :) Просто пройдемся по фактам, что здесь и как.
Сегодня будет необычный пост, в котором я буду разрушать или подтверждать мифы о кадровых агентствах (КА), как это когда-то делали Адам Сэвидж и Джэми Хайнеман в одном известном шоу :) Погнали!
Читать: https://habr.com/ru/post/598471/?utm_campaign=598471
8 543
Top 10 Free Courses for Java Developers to Learn Online in 2022 - Best of Lot
Hello guys, the Internet is full of useful resources, and no matter what you want to learn, there is something useful available for free. You just need to commit your time and effort. But at the same...
Read: http://www.java67.com/2018/08/top-10-free-java-courses-for-beginners-experienced-developers.html
8 543
Migrating Neo4j Graph Schemas With Neo4j Migrations
Neo4j Labs has released Neo4j Migrations, a database migration and refactoring tool that offers version control for relational databases. Inspired by FlywayDB, the tool supports migrations based on Cypher statements or Java. Triggering the migrations is possible via the CLI, Maven plugin, or a Spring Boot starter.
By Johan Janssen
Read: https://www.infoq.com/news/2021/12/neo4j-migrations/
8 543
Java News Roundup: More Log4Shell Statements, Spring and Quarkus Updates, New Value Objects JEP
This week's Java roundup for December 20th, 2021, features news from OpenJDK with a new draft on value objects, JDK 18, JDK 19, Project Loom, additional statements from vendors on Log4Shell, numerous Spring and Quarkus updates, Hibernate ORM 6.0.0-M3, point releases from Apache Camel and Camel Quarkus, Apache Tika 2.2.1 and GraalVM Native Build Tools 0.9.9.
By Michael Redlich
Read: https://www.infoq.com/news/2021/12/java-news-roundup-dec20-2021/
8 543
5 Best SQL and Database Online Courses for Beginners in 2022
Hello guys, if you want to learn SQL and Database and look for the best Udemy courses, you have come to the right place. Earlier, I have shared the best free SQL courses, which contain free courses...
Read: http://www.java67.com/2021/10/5-best-udemy-courses-to-learn-sql-and-database-.html
8 543
Тестирование GraphQL: подходы, инструменты, автоматизация
Несколько месяцев назад на моем пути возник GraphQL.
Это произошло, когда я присоединилась к одному из наших проектов, где был не только привычный REST, но и GraphQL API. Это было моё первое знакомство с ним. Я понятия не имела, что он собой представляет, в чем его особенности, а самое главное для меня, как QA инженера – не знала, как его тестировать.
Ниже я расскажу, что делала я, с какими проблемами сталкивалась, с чего можно начать и что важного и особенного надо знать про GraphQL для успешного тестирования как руками, так и с помощью автотестов. Вполне вероятно, что это поможет и вам разобраться в данном вопросе.
Читать: https://habr.com/ru/post/598149/?utm_campaign=598149
8 543
Top 10 Cloud Certification (AWS, Azure, and GCP) You can Aim in 2022 - Best of Lot
Hello guys, if you are aiming for cloud certifications in 2022 but are not sure which cloud certification should you go for then you have come to the right place. Earlier, I have shared a list of...
Read: http://www.java67.com/2020/09/top-10-cloud-certification-you-can-aim.html
8 543
Разбираем Log4j уязвимость в деталях… с примерами и кодом
Все о той же критической уязвимости в Log4j, но с примерами и кодом.
Читать: https://habr.com/ru/post/597981/?utm_campaign=597981
8 543
MicroStream 6.0 Supports JDK 17, Spring Boot and Helidon
MicroStream, the JVM data storage engine providing in-memory storage to fully or partially persist and restore Java object graphs, has released version 6.0 featuring added support for Java 17, Spring Boot integration, Deep-copy utility and the elimination of various bugs.
By Andrea Messetti
Read: https://www.infoq.com/news/2021/12/microstream-storage-engine-6/
现已上线!2025 年 Telegram 研究 — 年度关键洞察 
