Search Results for: java 8
-
for loop
Sum Array of Numbers with for loop
This is an example of how to get the sum of the numbers in an array using a for loop. The…
Read More » -
for loop
Check for Palindrome Number with for loop
In this example we shall show you how to check if a palindrome number exists in an array, using a…
Read More » -
for loop
Generate Prime Numbers with for loop
With this example we are going to demonstrate how to generate prime numbers with a simple for loop. A prime…
Read More » -
for loop
Calculate Fibonacci Series with for loop
In this example we shall show you how to calculate Fibonacci series using a for loop in Java. To calculate Fibonacci…
Read More » -
try/catch/finally
try/catch/finally InputStream example
This is an example of an InputStream in a try/catch/finally statement. Using try/catch/finally statement to create an InputStream implies that…
Read More » -
primitives
short
In this example we shall show you how to use a short type in Java. The short data type is a…
Read More » -
primitives
long
With this example we are going to demonstrate how to use a long type in Java. The long data type…
Read More » -
primitives
int
This is an example of how to use an int type in Java. The int data type is a 32-bit…
Read More » -
primitives
byte
In this example we shall show you how to use a byte type in Java. The byte data type is…
Read More » -
Enum
Using an enum as a state machine
In this short example, a parser state machine processes raw XML from a ByteBuffer. Each state has its own process…
Read More »