Core Java APIs and programming techniques
Technologies related to Java APIs (application programming interfaces) and JDK (Java Development Kit) form the cornerstone of modern, enterprise-grade software development. Here we explore all the Java features that make the JVM great through programming tutorials, real-world code samples and expert opinions from Java champions.
Top Stories
-
Video
01 May 2024
Java's default constructor tutorial
They say you don't get anything for free, but in the world of software development, Java developers can use the default constructor without paying any price. Continue Reading
-
Tip
29 Apr 2024
Know how and when to use blockchain vs. distributed ledgers
Blockchain and distributed ledgers are similar but not quite synonymous. Learn their differences and how they are used, including together, for transactions and data storage. Continue Reading
-
Blog Post
18 Jul 2022
How to format a Java int or long with printf example
Here's a quick tutorial on how to use printf to format Java int, long, short and byte values. It's pretty easy to do. And the output you can generate can be very visually appealing. Continue Reading
-
Blog Post
17 Jul 2022
How to format a Java table with printf example
Why not make your console output look pretty? Create, format and print data tables with Java printf statements, along with a clever combination of dashes, pipelines and printf placeholders. Continue Reading
-
Blog Post
11 Jun 2022
Example Java String palindrome checker program using recursion
There are many ways to write a Java String palindrome program. In this Java palindrome example we demonstrate recursion and how the use of loops, arrays, Scanner and the reverse method can improve ... Continue Reading
-
Blog Post
09 Jun 2022
Java length vs length(): What's the difference?
Have you ever been confused between length and length() in Java? Here we show you the difference between Java length properties and methods, and when to use them in your code. Continue Reading
-
Blog Post
20 Apr 2022
CDI Full vs CDI Lite: What's new in Contexts and Dependency Injection 4.0
There's an interesting change packaged inside the CDI 4.0 release that will change the way you think about the API. Version 4.0 of Jakarta Contexts and Dependency Injection (CDI) changed the ... Continue Reading
-
Tip
13 Apr 2022
Either log or rethrow Java exceptions, but never do both
When an exception occurs in your Java code, you can log it or you can rethrow it -- but don't do both. Here's why you must avoid that exception handling antipattern. Continue Reading
-
Tip
01 Apr 2022
7 tips to choose the right Java library
Your application is only as secure and reliable as the external libraries you use. Here's a list of the top 7 things to consider when choosing a software library for your project. Continue Reading
-
Tutorial
30 Mar 2022
An example of how suppressed exceptions in Java work
Don't ignore suppressed exceptions. In this quick tutorial we show you how to anticipate when code will throw suppressed exceptions, along with the best practices to handle them. Continue Reading
-
Tutorial
30 Mar 2022
A simple 'try with resources' in Java example
Java's 'try-with-resources' exception handling feature can help you write better, more effective Java code. Here's a quick example of the try with resources construct in action. Continue Reading
-
Quiz
21 Mar 2022
A tough, multiple choice Java exception handling quiz
Just how well do you know exception handling in Java? These 10 tough multiple-choice questions on checked and unchecked exceptions will test your error handling mettle. Continue Reading
-
Tip
16 Mar 2022
Fix these 10 common examples of the RuntimeException in Java
Don't let the occurrence of a RuntimeException in Java bring your code to a standstill. Here are 10 examples of how to avoid runtime exceptions in Java. Continue Reading
-
Tip
08 Mar 2022
Fix the 5 most common types of runtime errors in Java
The key to bug-free code is an awareness of the most common types of runtime errors in Java, along with the knowledge of how to avoid them. Continue Reading
-
Tutorial
11 Feb 2022
Fix the top 10 most common compile time errors in Java
Flummoxed why your Java code won't compile? Here are the 10 most commonly encountered Java compile errors, along with the fixes that will get your code working in no time. Continue Reading
-
Opinion
01 Feb 2022
5 tech trends that foretell the future of Java in 2022
Here's what 2022 has in store for developers, programmers and DevOps professionals who work in the server-side Java space. Continue Reading
-
Definition
25 Jan 2022
AJAX (Asynchronous JavaScript and XML)
AJAX (Asynchronous JavaScript and XML) is a technique aimed at creating better and faster interactive web apps by combining several programming tools including JavaScript, dynamic HTML (DHTML) and Extensible Markup Language (XML). Continue Reading
-
Tip
10 Jan 2022
Binary and hexadecimal numbers explained for developers
For developers who are intimidated by bit shifts and hex operation, here's a thorough explanation of how binary and hexadecimal number systems work. Continue Reading
-
Blog Post
31 Dec 2021
The psychology of offering developers programming advice
Need to provide programming advice, or perhaps even harsh criticisms to a team of developers? Here's a nice way, pyscyhologically sound, way to do it. Continue Reading
-
Tip
06 Dec 2021
Problems with Java modules still plague developers
The Java Platform Module System promised to fix the missteps of the past. Unfortunately, it has repeated the problems that plagued OSGi and JBoss Modules. Continue Reading
-
Tip
18 Nov 2021
Iterator vs. ListIterator: Which interface should you choose?
When the need exists to manipulate an ordered collection, the Java Iterator runs out of steam. Learn how Java's ListIterator improves upon the more generic Iterator interface. Continue Reading
-
Tip
14 Oct 2021
5 best Java 17 features that developers will love
The new Java 17 release contains plenty of new features that will intrigue developers. Here are five features that should push developers off the Java 11 LTS to JDK 17. Continue Reading
-
Definition
13 Oct 2021
Hibernate
Hibernate is an open source object relational mapping (ORM) tool that provides a framework to map object-oriented domain models to relational databases for web applications. Continue Reading
-
Tip
30 Sep 2021
3 simple Java Hello World examples
Are you a developer who's new to Java? Here are three ways to write a Hello World program in Java on Eclipse and get started with the popular programming language. Continue Reading
-
Blog Post
14 Sep 2021
Every change between JDK 11 and the Java 17 LTS release
Wondering what's included in the new Java 17 LTS release? Here's a list of all the changes made to the JDK between the Java 11 and Java 17 LTS releases. Continue Reading
-
Guest Post
18 Aug 2021
The benefits and drawbacks of Java's fail-safe iterators
Iterators in Java are a simple mechanism to help developers avoid runtime exceptions. Let's explore the difference between fail-fast and fail-safe iterators. Continue Reading
-
Answer
16 Jul 2021
Kebab vs. camel case: How these naming conventions differ
What is the difference between a variable written in kebab case vs. camel case? Here we'll show you how these naming conventions differ and when to use one over the other. Continue Reading
-
Feature
25 Jun 2021
Java naming conventions, explained
You could start a Java variable with a dollar sign, but no one does. When you write Java code, always follow these standard Java naming conventions. Continue Reading
-
Answer
23 Jun 2021
Why is Java platform-independent?
Sun Microsystems architects designed Java to be cross-platform. But why? Here we look at not only why Java works across platforms, but also how it achieves its platform independence. Continue Reading
-
Blog Post
03 Jun 2021
Fix the ConcurrentModificationException
Has the ConcurrentModificationException been thrown in you Java app? Here are four simple ways to fix the ConcurrentModificationException in your code. Continue Reading
-
Tip
30 Apr 2021
10 Jenkins alternatives for developers
Looking for an alternative to Jenkins in your CI/CD environment? Consider options from Atlassian, GitLab, Spinnaker and more to see if they better fit your development needs. Continue Reading
-
Answer
30 Apr 2021
Camel case vs. snake case: What's the difference?
The use of white space is what separates camel case and snake case. Camel case has none, while snake case uses underscores. Let's review some examples to make this clear. Continue Reading
-
Blog Post
30 Apr 2021
Yes, the original name for Java was Oak
When Sun Microsystems first developed a programming language to power their Star7 entertainment controller, they named it Oak, not Java. Continue Reading
-
Quiz
29 Apr 2021
Test your knowledge of Java foundations
Whether you're new to Java or have worked with the language for years, you need to know the foundational building blocks. Review the basics in this Java quiz. Continue Reading
-
Feature
27 Apr 2021
A guide to common variable naming conventions
Every developer should know the basic variable naming conventions to more easily move from language to language. Review the common ones here like Pascal, camel and snake case. Continue Reading
-
Answer
23 Apr 2021
Kubernetes vs. Rancher: The differences all devs should know
How are Kubernetes and Rancher related? Here are the basics developers need to know about Kubernetes and Rancher and how they can ultimately work together. Continue Reading
-
Answer
15 Apr 2021
Interpreted vs. compiled languages: What's the difference?
Learn the difference between compiled languages like Go and interpreted ones like Java. One language is platform agnostic. The other can run a bit faster. Continue Reading
-
News
08 Apr 2021
Microsoft previews OpenJDK distro to the delight of devs
In a move meant to attract more Java developers to its Azure cloud and further support the Java community, Microsoft launched a preview of its own distribution of OpenJDK. Continue Reading
-
News
06 Apr 2021
Supreme Court ruling on Java APIs eases developer worries
Now that the Supreme Court has ruled for Google over Oracle in their high-stakes copyright battle over Java APIs, developers can rest easier -- but some questions linger. Continue Reading
-
Blog Post
30 Mar 2021
Recursion vs Iteration: What's the difference?
This Java recursion tutorial shows you how to create a recursive Java factorial function and compares these methods to iterative ones. Continue Reading
-
Answer
26 Mar 2021
Pascal case vs. camel case: What's the difference?
It's easy to confuse camel case and Pascal case. We'll show you the difference between the two common variable naming conventions, along with some examples. Continue Reading
-
News
25 Mar 2021
AdoptOpenJDK moves to Eclipse Foundation as Adoptium
The Eclipse Foundation has launched a new working group to provide governance, IP services and developer advocacy for Adoptium, the newly renamed AdoptOpenJDK distribution of the OpenJDK spec. Continue Reading
-
Definition
24 Mar 2021
Pascal case
Pascal case is a naming convention in which developers start each new word in a variable with an uppercase letter. Continue Reading
-
News
16 Mar 2021
Oracle delivers Java 16 to developers
Oracle has released Java 16, the latest version of the Java Development Kit (JDK) for developers. The company also moved the OpenJDK source code repositories from Mercurial to Git. Continue Reading
-
Answer
08 Mar 2021
How do microservices API gateways aid monolith migrations?
How do you move a set of REST resources to microservices? One way is to use an API gateway. Follow this example to learn how migrate to microservices-oriented architecture. Continue Reading
-
News
03 Feb 2021
Oracle adds GraalVM Enterprise to Java SE subscription
Oracle's GraalVM Enterprise compiler technology is now available to developers as part of the Java SE subscription. GraalVM increases application performance. Continue Reading
-
Definition
15 Jan 2021
Java Flight Recorder
Java Flight Recorder is a Java Virtual Machine (JVM) profiler that gathers performance metrics without placing a significant load on resources. Continue Reading
-
Video
15 Jan 2021
5 ways to force Java garbage collection
A developer can't technically force garbage collection in Java, but it can be made a priority. If you need to free up heap space, here are five ways to prioritize it in the JVM. Continue Reading
-
Feature
23 Dec 2020
What's in a name? What developers can expect in Jakarta EE 9
What Oracle called the Java EE API is now called Jakarta EE API under the Eclipse Foundation. Here's what developers can expect in the Jakarta EE 9 release. Continue Reading
-
Quiz
15 Dec 2020
Test your knowledge of variable naming conventions
What's the difference between snake case and camel case? Or kebab case and pascal case? Try this 10-question variable naming quiz to learn more about programming variables. Continue Reading
-
Definition
14 Dec 2020
Kebab case
Kebab case -- or kebab-case -- is a programming variable naming convention where a developer replaces the spaces between words with a dash. Continue Reading
-
Tutorial
18 Nov 2020
An Apache Commons FileUpload example and the HttpClient
In this article you will have a look at the capabilities of the HttpClient component and also some hands-on examples. Continue Reading
-
Answer
05 Nov 2020
Why are curly braces in programming languages important?
Curly braces play a big role in code structure within popular programming languages such as Java, C++ and more. Here's how to properly line up code with curly brackets. Continue Reading
-
Feature
25 Sep 2020
How IT can deal with challenges of a move online post COVID-19
What will the long-term effects be of COVID-19 on the IT industry? Early indications show that virtual conferences and telecommuting are signals of what the future will hold. Continue Reading
-
Feature
25 Sep 2020
How COVID-19 created a demand for COBOL basics
An uptick in COBOL interest stems from its presence in entrenched, legacy government apps, such as unemployment or apps for emergency loans. A rush to use these apps at the start of the COVID-19 pandemic reminded us all that COBOL remains a force in 2020. Continue Reading
-
News
11 Jun 2020
Oracle's release cadence opens door for Java support rivals
Oracle has opened the door for competitors to chip away at its hold on the market for providing Java support to enterprise customers. Continue Reading
-
News
08 Jun 2020
Dojo Toolkit 7 focuses on JavaScript developer productivity
Dojo Toolkit version 7 is now available. The widely used, mature JavaScript framework favored by enterprise shops gains more features for developer productivity. Continue Reading
-
News
28 May 2020
Quarkus goes GA, gains Red Hat Runtimes support
With Quarkus, Red Hat targets the popular Spring Boot framework to help developers use Java as a first-class language to build microservices and container-based applications. Continue Reading
-
Video
27 May 2020
HashMap vs. Hashtable: Which map should you choose?
When HashMap replaced Hashtable as part of the Java 1.2 release, it moved away from how developers previously used the collections API and Java maps. Continue Reading
- Definition 14 May 2020
-
News
04 May 2020
Oracle's GraalVM finds its place in Java app ecosystem
Oracle's GraalVM, a universal virtual machine that runs apps written in Java and other languages, has carved out a spot in the Java ecosystem. Continue Reading
-
Blog Post
21 Apr 2020
Kubernetes 1.18 adds more power, addresses shortcomings
Kubernetes is no doubt a powerful technology, but it has its shortcomings. For example, debugging under Kubernetes has always been a challenge. When it started out, Kubernetes was intended to run ... Continue Reading
-
Tip
25 Mar 2020
How to refactor the God object class antipattern
Loose coupling can inadvertently create a God object problem in an object-oriented software system. Here's how to get rid of the issue and simplify the design in five easy steps. Continue Reading
-
News
23 Mar 2020
Oracle ships Java 14 with new preview, productivity features
With Java 14, Oracle delivers features to the Java language and platform that enhance the productivity of developers building new enterprise applications. Continue Reading
-
Tutorial
30 Jan 2020
Why the 8 Java primitive data types are not objects
What's the difference between Java primitive types and objects? To start, don't classify primitive types as objects. Let's explore the 3.5 categories that primitive types fall into. Continue Reading
-
Feature
30 Jan 2020
A brief history of Java: How it forever changed programming
The Java programming language is an important tool in an application developer's quiver. But Java has also undergone many changes on the road to becoming the standard it is today. Continue Reading
-
Definition
13 Dec 2019
just-in-time compiler (JIT)
A just-in-time (JIT) compiler is a program that turns bytecode into instructions that can be sent directly to a computer's processor (CPU). Continue Reading
-
Opinion
11 Dec 2019
Don't ever put a non-Java LTS release into production
Development teams should avoid non-long-term support releases at all costs. Pay attention to the Java release cycle to make sure your updates are supported. Continue Reading
-
Video
26 Nov 2019
Tomcat vs. Jetty: How these Java application servers compare and differ
What is your Java application server of choice? Where you stand on the Jetty vs. Tomcat debate probably lends a hand to which one you use in production. Continue Reading
-
Video
25 Nov 2019
Simple Java 8 Predicate example with lambda expressions and interfaces
Use this Java Predicate example to help developers learn lambdas, expand functional programming and reduce code verbosity in their environment. Continue Reading
-
News
25 Oct 2019
AWS ups Java support, joins Java Community Process
By joining the Java Community Process, AWS will have its say over how the Java language and platform will evolve to meet the needs of cloud-native computing environments. Continue Reading
-
News
24 Oct 2019
AWS gets behind Rust programming language
AWS has joined Microsoft, Google, Mozilla and other major vendors in using and supporting the Rust programming language as a system programming language. Continue Reading
-
News
07 Oct 2019
GitHub tempts enterprises with Semmle, security enhancements
With the Semmle semantic code analysis engine freshly added to its quiver, GitHub gives corporate development teams one way to boost security of their open source software. Continue Reading
-
News
24 Sep 2019
Ecstasy programming language targets cloud-native computing
Startup Xqiz.it has a new Ecstasy programming language that aims to arm developers for the cloud-native computing era with features that Java and other programming languages lack. Continue Reading
-
Opinion
19 Sep 2019
Microsoft vs. IBM: A major shift in Java support
Once an afterthought in the Java community, Microsoft has seemingly overtaken IBM as the preeminent advocate among developers at the Oracle Code One conference. Continue Reading
-
News
18 Sep 2019
Eclipse launches Che 7 IDE for Kubernetes development
The Eclipse Foundation has introduced Eclipse Che 7, a new version of the Eclipse Che cloud-based integrated development environment aimed at creating applications on Kubernetes. Continue Reading
-
Feature
18 Sep 2019
Java's popularity hinges on future developers, adaptability
Java needs to focus on the youth, adapt to emerging tech and constantly evaluate its performance to remain popular among developers. Continue Reading
-
Feature
17 Sep 2019
No doubt now about Java release cycle
At the Oracle Code One keynote, the recent track record of on-time releases and feature enhancements is a topic to boast about. Continue Reading
-
News
11 Sep 2019
Eclipse completes enterprise Java move with Jakarta EE 8
The Eclipse Foundation has assumed control of the Java EE enterprise platform and specifications from Oracle and has launched an all open source version of the technology. Continue Reading
-
News
20 Aug 2019
Microsoft gains instant Java credibility with jClarity buy
Microsoft has acquired jClarity to help optimize its Azure cloud platform to run Java workloads, a coveted target for the now open source-friendly software giant. Continue Reading
-
Tutorial
08 Aug 2019
How to install the JDK on Windows and set up JAVA_HOME
You have options when it comes to JDK installations on Windows and Linux. Here are some helpful tips to ensure a proper install and why JAVA_HOME can be helpful. Continue Reading
-
Video
29 Jul 2019
How to use Spring Boot application.properties file to externalize configuration
Don't wait to externalize data in your Spring configuration any longer. Master the application.properties file with this example to get more from your data. Continue Reading
-
Definition
25 Jul 2019
JAVA_HOME
JAVA_HOME is an operating system (OS) environment variable which can optionally be set after either the Java Development Kit (JDK) or the Java Runtime Environment (JRE) is installed. Continue Reading
-
Blog Post
18 Jul 2019
How to become a good Java programmer without a degree
Great Java programmers are judged by their work, not their resume. How to become a good Java programmer without a degree largely depends on your own course of action and the hours you spend ... Continue Reading
-
News
19 Jun 2019
Microsoft Visual Studio Code installer supports AdoptOpenJDK
Microsoft targets Java developers with a Visual Studio Code installer for Java that takes care of the overall Visual Studio Code setup for developers. Continue Reading
-
Video
12 Jun 2019
The top Java deployment tools to use on your next project
Java application deployment tools such as Maven and Gradle can be beneficial for your IT team. Compare those and other options, along with frameworks, to ease this process. Continue Reading
-
News
07 Jun 2019
Pivotal Spring Runtime extends Java support, company lifeline
Pivotal's distribution of OpenJDK, the open source version of Java, joins the ranks of Amazon, Azul, IBM, Red Hat and others that provide long-term Java support. Continue Reading
-
Video
24 May 2019
JDBC vs. ODBC: What's the difference between these APIs?
There are more similarities between ODBC and JDBC than there are differences. But, the differences are significant. Here we highlight them. Continue Reading
-
News
26 Apr 2019
NetBeans Java IDE becomes top-level Apache project
The NetBeans Java development environment has achieved top-level project status at the Apache Software Foundation, a leading open source software project hosting organization. Continue Reading
-
News
28 Mar 2019
JavaScript popularity drives TypeScript adoption among devs
More developers choose to work with JavaScript to build web, server-side and mobile applications, while TypeScript has quickly gained traction, according to recent analysis. Continue Reading
-
News
22 Mar 2019
Oracle's Java 12 adds developer productivity features
The latest version of the Java Platform, Standard Edition, delivers new features to make developers more productive with the Java programming language. Continue Reading
-
Definition
11 Mar 2019
jQuery
jQuery is an open-sourced JavaScript library that simplifies creation and navigation of web applications. Continue Reading
-
News
07 Mar 2019
Red Hat eyes cloud-native Java future with Quarkus
Red Hat's Quarkus project aims to raise Java up to the cloud and update the popular programming language for cloud-based computing situations and projects. Continue Reading
-
Blog Post
27 Feb 2019
Java Supplier interface example for functional programming
Functional supplier interface in Java tutorial There are only half a dozen classes you really need to master to become competent in the world of functional programming. The java.util.function ... Continue Reading
-
Definition
19 Feb 2019
OpenJDK
OpenJDK is a free, open-source version of the Java Development Kit for the Java Platform, Standard Edition (Java SE). Continue Reading
-
Blog Post
04 Feb 2019
A quick look at inferred types and the Java var keyword
Here's a quick look at the Java var keyword and what it looks like when you use inferred types in your code. Continue Reading
-
Opinion
22 Jan 2019
Use Java method modifiers to avoid public method antipattern
Follow best practices for Java method design, and don't allow one public class to call another. If you skipped this step, be prepared to pay the consequences. Continue Reading
-
Blog Post
01 Jan 2019
How to use Java's functional Consumer interface example
The functional consumer interface is a key part of the Java Streams API. Here is a simple Consumer interface example to show you how to use this Java component. Continue Reading
-
Feature
27 Dec 2018
Year in review: Five topics that epitomized Java in 2018
In 2018, we focused on what the future of Java might look like. With the IBM-Red Hat merger and the ascension of DevOps, the life and times of the Java developer are changing. Continue Reading
-
News
26 Dec 2018
Red Hat's support for OpenJDK on Windows anchors Java apps
Red Hat brings long-term support for open source Java to developers who use Windows, so organizations can now choose one Java platform for desktop, data center and cloud. Continue Reading
-
Feature
18 Dec 2018
Recent open source flaw highlights danger of social engineering hacks
What happens when open source developers hand the keys of their project over to a new maintainer? It can expose applications to serious security threats. Continue Reading
-
Opinion
07 Dec 2018
Why there's not really a best first programming language to learn
Some consider Java to be the best first programming language for developers to learn. But does it really matter? Most languages are made up of the same building blocks. Continue Reading