java interface

Interfaces Another way to achieve abstraction in Java, is with interfaces. An interface is a completel...

java howto add two numbers

Add Two Numbers Learn how to add two numbers in Java: Example int x = 5; int y = 6; int sum = x +...

java hashset

Java HashSet A HashSet is a collection of items where every item is unique, and it is found in the java...

java files create

Create a File To create a file in Java, you can use the createNewFile() method. This method returns...

java exercises

You can test your Java skills with W3Schools' Exercises. Exercises We have gathered a variety of Java...

java enums

Enums An enum is a special "class" that represents a group of constants (unchangeable variab...

java compiler

Java Compiler (Editor) With our online Java compiler, you can edit Java code, and view the result in...

java classes

Java Classes/Objects Java is an object-oriented programming language. Everything in Java is associated...

java class attributes

Java Class Attributes In the previous chapter, we used the term "variable" for x in the exampl...

java break

Java Break You have already seen the break statement used in an earlier chapter of this tutorial. It...

java booleans

Java Booleans Very often, in programming, you will need a data type that can only have one of two values...

java arrays

Java Arrays Arrays are used to store multiple values in a single variable, instead of declaring separate...

java arraylist

Java ArrayList The ArrayList class is a resizable array, which can be found in the java.util package...

java abstract

Abstract Classes and Methods Data abstraction is the process of hiding certain details and showing onl...

Java default

Java is a programming language. Java is used to develop mobile apps, web apps, desktop apps, games and...