In this example we show how to count the total amount of characters in a string using Java Example In this example we use a for loop to iterate through …
-
-
In this example we show you how to convert a string to lowercase in Java Example We will take input from the user We will then use the built-in function …
-
In this example we show you how to convert a string to uppercase in Java Example We will take input from the user We will then use the built-in function …
-
In this code example we show you how to reverse a string in Java To reverse the string, we will use the reverse() method of the StringBuilder class The reverse() …
-
In this example we show you how to join 2 strings in Java We will give you 2 examples, there are several ways you can join 2 strings in Java …
-
In this example we show how to compare two different strings in Java There are a couple of ways of doing this, in this example we will use the equals() …
-
In this example we will show how to get the current date and time using the Calendar class in Java We then use various fields to show the Day of …
-
This example gets the current date and time in Java using the Date() class Example import java.util.*; public class JavaApplication1 { public static void main(String[] args) { Date currDate = …
-
In this example we show how to check if a number is positive, negative or zero in Java Example We take user input then use an if – else statement …
-
In this article we look at how to check if a number is odd or even in Java Example In the program, we first create a Scanner object, and then …
-
In this example we show you how to display the factorial of a number in C++ The factorial of a non negative number is the product of all the integers …
-
In this example we show how to generate a multiplication table in C++ Example We take input from the user and then use a for loop to display the table …