Java Tutorials

Java indexOf(): A How-To Guide

The Java indexOf() method finds the index position at which a specified string begins. This method lets you find a string within another string. If the value you specify is not present in the string through which you are searching,…

Java Selection Sort: A How-To Guide

The Java selection sort finds the smallest item in a list and moves that value to the start of the list. This happens repeatedly until every element in the first list has been sorted. The selection sort returns the sorted…

Java break Statement: A How-To Guide

A Java break statement halts the execution of a loop. When a break statement is run, a program starts to run the code after a statement. If a break statement is used in a nested loop, only the innermost loop…

Java Ternary Operator: A Step-By-Step Guide

The Java ternary operator lets you write an if statement on one line of code. A ternary operator can either evaluate to true or false. It returns a specified value depending on whether the statement evaluates to true or false.…

Learn to Sort ArrayList in Java

The Collections.sort() method sorts a Java ArrayList in ascending order. Collections.reverse() reverses the order of a Java ArrayList. You need to import the Java Collections package to use these methods. How to Sort an ArrayList in Java You may encounter…

How to Use the Java continue Statement

The Java continue statement stops one iteration in a loop and continues to the next iteration. This statement lets you skip particular iterations without stopping a loop entirely. Continue statements work in for and while loops. Java for and while…

How to Convert a Java String to Char Array

The toCharArray() method converts a string to a char array in Java. This method lets you manipulate individual characters in a string as list items. Spaces, numbers, letters, and other characters are all added to the char array. When coding,…

Java User Input and Scanner Class: A Step-By-Step Guide

The Scanner class is used to read Java user input. Java Scanner is built into the java.util package, so no external libraries are needed to use it. Scanner reads text from standard input. This text is returned to the main…

A Step-By-Step Guide to charAt in Java

The Java charAt() method returns a character at a specific index position in a string. The first character in a string has the index position 0. charAt() returns a single character. It does not return a range of characters. When…

How to Use Java Math.random

The Math.random()Java method generates a pseudorandom number between 0.0 and 1.0. The resulting random number can be multiplied to get a range outside 0-1, and the result can be 0 but is always less than 1.  When you’re programming, there are…

Get matched modal

Find the best bootcamp for you

Our matching algorithm will connect you to job training programs that match your schedule, finances, and skill level.