Groovy String take() examples

Groovy is called Groovy for a reason - it is a factory of fun and intuitive way of programming. Case in point? The Groovy String take method is a method that is implemented because the name is intuitive, even though we can simulate it's behavior using the subtring method. But we explore here some samples on how to use Groovy String Take method.

Java Arrays Fill

We love to work with arrays because they are simple yet very powerful data structure in Java Language. It is also very intuitive and easy to use. If our needs does not require too much dynamic sizes, then arrays are just fine. But the first problem we encounter in working with arrays is how to fill it with initial values. Specially if the size of an array is created through a variable - meaning variable size that we don't know initially. And say we need to initialize the entire thing with a specific value, or only a portion of the array. The Arrays.fill() method is a good fit for this need. In this post we try to explore how to use Java Arrays.fill() method in different scenarios.

Java Sum Array

We love to use arrays as it is a very simple data structure to create and manipulate. In fact, such data structure exists in much older programming languages. Sometimes we just don't need the bells and whistles of much more feature rich collection classes. In this post, we explore one array manipulation in case we have an array of numeric values. We will give examples below on how to Sum and Array In Java.

how to reverse a number in java using for loop

We try to solve specific logical problems in Java using some form of loops. In this post we present an example on how to

Factorial of a number in Java using while loop

In this post we tackle a simple problem of calculating the factorial of a number. Specifically, we determine Factorial of a number in Java using while loop.

automorphic number program in java using while loop

One of the best way to be in shape with our programming is to solve problems. So we present below the problem and sample solution to :

Perfect number in Java using while loop

This is an exciting problem where we want to determine if a number is a perfect number or not

Palindrome number in Java using while loop

In this post we tackle another difficult program to solve that, is determining if a number is a palindrome. Below is the code to solve that. That is Determining Palindrome number in Java using while loop.

Reverse number in Java using for loop

In this post we solve a slightly difficult problem, that is trying to reverse the digits of a number. See below on example of Reverse number in Java using for loop.

How to print even numbers in Java using while loop

In this post we try to give example on how to print even numbers in java using while loop. This is pretty simple so head down to the sample code: