java ref string

All String Methods The String class has a set of built-in methods that you can use on strings. Method...

java ref math

The Java Math class has many methods that allows you to perform mathematical tasks on numbers. All Math...

java quiz

You can test your Java skills with W3Schools' Quiz. The Test The test contains 25 questions and there...

java polymorphism

Java Polymorphism Polymorphism means "many forms", and it occurs when we have many classes...

java methods

A method is a block of code which only runs when it is called. You can pass data, known as parameters...

java methods param

Parameters and Arguments Information can be passed to methods as parameter. Parameters act as variables...

java methods overloading

Method Overloading With method overloading, multiple methods can have the same name with different ...

java math

The Java Math class has many methods that allows you to perform mathematical tasks on numbers. Math...

java linkedlist

Java LinkedList In the previous chapter, you learned about the ArrayList class. The LinkedList class...

java lambda

Java Lambda Expressions Lambda Expressions were added in Java 8. A lambda expression is a short block...

java iterator

Java Iterator An Iterator is an object that can be used to loop through collections, like ArrayList...

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...