Practical solutions

Java Howtos How-To Guides

Solve the problem. Keep building. Collection of Java how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Sort an Array in Java Without Using the Sort() MethodIn this article, we'll discuss how to sort an array in Java without using the sort() method. How to Compare String With the Java if StatementThis article will tackle about comparing strings through if statements in Java. How to Fix Java Invalid Method Declaration; Return Type RequiredHow to fix invalid method declaration; return type required in Java. How to Use setFont in JavaThis tutorial shows the ways to use setFont method in Java. What Does the <E> Mean in JavaThis article tells about the use of the E parameter in generics in Java. How to Sort a List Alphabetically in JavaThis article introduces how to sort a list alphabetically in Java. How to Add ActionListener to JButton in JavaThis tutorial teaches how to add an ActionListener to a JButton and discusses the best practices associated with it. Array Passed By Value or Passed By Reference in JavaThis article introduces check if array is passed by value or passed by reference in Java. How to Convert ArrayList to Int Array in JavaThis article discusses four ways to convert an ArrayList to int Array in Java. How to Clear a StringBuilder in JavaThis article shows ways how you can clear or empty a StringBuilder in Java. Associative Array in JavaThis article introduces the associative array in Java. List of Arrays in JavaThis article discusses how we can create a list of arrays in Java. How to Get HostName in JavaThis article demonstrates how to get hostname in Java. How to Get Maximum Value From A Priority queue in JavaThis tutorial demonstrates how to get maximum value from a priority queue in Java. How to Solve Divide by Zero Exception in JavaThis article will explain why integer division by zero gives an error but floating point zero returns an Inf in Java. How to Create a Number Guessing Game in JavaThe task is to write a Java program for a guessing game. The guessing game is a constraint satisfaction problem. You have to guess the right numbers in a given number of trials; otherwise, you do not win. How to Create Button Click Event in JavaThis tutorial demonstrates how to create a button click event in Java. How to Create a Transparent Scene in JavaFXThis tutorial will show how we can create transparent scene in JavaFX. Gridpane Alignment in JavaFXThis tutorial will discuss grid and child node alignment in JavaFX. How to Slice an Array in JavaThis article will help you in slicing an array into a subarray in Java. How to Display Text in JavaFXThis tutorial demonstrates how to display text in JavaFX. Class Expected Error in JavaIn this guide, we will look into the .class expected error in Java. How to Solve the Can Only Iterate Over an Array or an Instance of Java.Lang.Iterable Error in JavaWe will learn about the Java error can only iterate over an array or an instance of java.lang.iterable. We will see the reason this error occurs and what's the solution to it. Java getActionCommand() MethodThis tutorial demonstrates how to use getActionCommand() method in Java.