作者彙整: Rafael Chinelato Del Nero

Inheritance versus composition: How to choose

Inheritance and composition are two programming techniques developers use to establish relationships between classes and objects. Whereas inheritance derives one class from another, composition defines a class as the sum of its parts.Classes and obj… 閱讀全文

分類: Android News 安卓新聞, IT 資訊科技(信息技术), 熱門新聞 | 標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 在〈Inheritance versus composition: How to choose〉中留言功能已關閉

Does Java pass by reference or pass by value?

Many programming languages allow passing parameters by reference or by value. In Java, we can only pass parameters by value. This imposes some limits and also raises questions. For instance, if the parameter value is changed in the method, what happ… 閱讀全文

分類: Android News 安卓新聞, IT 資訊科技(信息技术), 熱門新聞 | 標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 在〈Does Java pass by reference or pass by value?〉中留言功能已關閉

Sorting with Comparable and Comparator in Java

Programmers frequently need to sort elements from a database into a collection, array, or map. In Java, we can implement whatever sorting algorithm we want with any type. Using the Comparable interface and compareTo() method, we can sort using alpha… 閱讀全文

分類: Android News 安卓新聞, IT 資訊科技(信息技术), 熱門新聞 | 標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 在〈Sorting with Comparable and Comparator in Java〉中留言功能已關閉

Sorting with Comparable and Comparator in Java

Programmers frequently need to sort elements from a database into a collection, array, or map. In Java, we can implement whatever sorting algorithm we want with any type. Using the Comparable interface and compareTo() method, we can sort using alpha… 閱讀全文

分類: IT 資訊科技(信息技术), java教學網站, 熱門新聞 | 標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 在〈Sorting with Comparable and Comparator in Java〉中留言功能已關閉

Thread behavior in the JVM

Threading refers to the practice of executing programming processes concurrently to improve application performance. While it’s not that common to work with threads directly in business applications, they’re used all the time in Java frameworks.As a… 閱讀全文

分類: Android News 安卓新聞, IT 資訊科技(信息技术), 熱門新聞 | 標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 在〈Thread behavior in the JVM〉中留言功能已關閉

Method overloading in the JVM

Welcome to the new Java Challengers blog! This blog is dedicated to challenging concepts in Java programming. Master them and you will be well on your way to becoming a highly skilled Java programmer.

The techniques in this blog take some effort to master, but they’ll make a great difference in your daily experience as a Java developer. Avoiding bugs is easier when you know how to properly apply core Java programming techniques, and tracking bugs is much easier when you know exactly what is happening on your Java code.

Are you ready to start mastering core concepts in Java programming? Then let’s get started with our first Java Challenger!  

To read this article in full, please click here

閱讀全文

分類: Android News 安卓新聞, IT 資訊科技(信息技术), 熱門新聞 | 標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 在〈Method overloading in the JVM〉中留言功能已關閉

String comparisons in Java

In Java, the String class encapsulates an array of char. Put simply, String is an array of characters used to compose words, sentences, or any other data you want.

Encapsulation is one of the most powerful concepts in object-oriented programming. Because of encapsulation, you don’t need to know how the String class works; you just need to know what methods to use on its interface.

When you look at the String class in Java, you can see how the array of char is encapsulated:

To read this article in full, please click here

閱讀全文

分類: 未分類 | 在〈String comparisons in Java〉中留言功能已關閉

Polymorphism and inheritance in Java

According to the legend Venkat Subramaniam, polymorphism is the most important concept in object-oriented programming. Polymorphism–or the ability of an object to execute specialized actions based on its type–is what makes Java code flexible. Desi… 閱讀全文

分類: IT 資訊科技(信息技术), java教學網站, 熱門新聞 | 標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 在〈Polymorphism and inheritance in Java〉中留言功能已關閉

Polymorphism and inheritance in Java

According to the legend Venkat Subramaniam, polymorphism is the most important concept in object-oriented programming. Polymorphism–or the ability of an object to execute specialized actions based on its type–is what makes Java code flexible. Desi… 閱讀全文

分類: Android News 安卓新聞, IT 資訊科技(信息技术), 熱門新聞 | 標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 在〈Polymorphism and inheritance in Java〉中留言功能已關閉

Java Challengers #4: Comparing Java objects with equals() and hashcode()

In this Java Challenger you’ll learn how equals() and hashcode() combine to make object comparisons efficient and easy in your Java programs. Simply put, these methods work together to verify if two objects have the same values.  

Without equals() and hashcode() we would have to create very large “if” comparisons, comparing every field from an object. This would make code really confusing and hard to read. Together, these two methods help us create more flexible and cohesive code.

閱讀全文

分類: Android News 安卓新聞, IT 資訊科技(信息技术), 熱門新聞 | 標籤: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 在〈Java Challengers #4: Comparing Java objects with equals() and hashcode()〉中留言功能已關閉