Articles

Java String: Trim String

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: Trim String

The java string class comes packaged with a trim method. The java string trim method removes the leading and trailing whitespace from a String. Let's write some code to implement the java string trim method.

Read More

Java String: String Has Whitespace

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: String Has Whitespace

Let's look at another example to determine if a java string has any character that is a whitespace character. The Java String class in java can contain any sequence of characters. Lets create an example to determine if a java string has a whitespace character.

Read More

Java String: String Has Text

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: String Has Text

Let's look at another example to determine if a java string has a given sequence of characters that is any character other than a whitespace character. The Java String class in java is a class which encapsulates a sequence of characters. A Java String is an object and has various methods which we can call.

Read More

Java String: String Has Length

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: String Has Length

Let's look at another example to determine if a java string has a length. The Java String class contains the length method. We can use this method to check the length of a java string.

Read More

Java String: Find The Length Of A String

By: Stephen Patrick | 26 May 2016 | Category: Java String

Java String: Find The Length Of A String

Java String are immutable objects as previously discussed. Lets see how we can find the length of a Java String. The Java String class contains the length method. We can use this method to find the length of a Java String.

Read More

Java Array: How To Join An Array

By: Stephen Patrick | 26 May 2016 | Category: Java Array

Java Array: How To Join An Array

Having previously talked about what an array is. Let's look at an example of how to join the elements of an array together. Joining the elements of a java array and returning it as a java.lang.String is a very common operation. Sometimes, we need to split a string into it's constituent parts, performing an operation on those parts, and put those parts back together to form the original String.

Read More

Java String Performance

By: Stephen Patrick | 25 May 2016 | Category: Java String

Java String Performance

A Java String as discussed in a previous section provides a data structure to treat a sequence of characters as a String. Java Strings have a number of performance issues that you as a Java Developer should be aware of.

Read More

Java String

By: Stephen Patrick | 25 May 2016 | Category: Java String

Java String

A Java String is a sequence of characters. A Java String can be considered an Array of characters where each index in the array is a character. A Java String can be defined using literal syntax by enclosing a sequence of characters between a pair of double quotes

Read More

Java Array: ToString Example

By: Stephen Patrick | 25 May 2016 | Category: Java Array

Java Array: ToString Example

Here we will show an example of how to convert a java int array into a String. In this example we will convert a java array to a String. The toString method is inherited by every java object, as it is a method of the java.lang.Object super Object. We will talk more about this method later.

Read More

Java Array: Find Max Value

By: Stephen Patrick | 25 May 2016 | Category: Java Array

Java Array: Find Max Value

Here we will show an example of how to find the maximum value of a java integer array. The max value of an array is simply the largest value the java array contains.

Read More

Java Array: Find Min Value

By: Stephen Patrick | 25 May 2016 | Category: Java Array

Java Array: Find Min Value

Here we will show an example of how to find the minimum value of a java integer array. The min value of an array is simply the smallest value the java array contains. If the java array has a length of 0 then the min value of the java array will be 0. Lets write some code to find the min value of the java array.

Read More

Java Array: Find Mean

By: Stephen Patrick | 25 May 2016 | Category: Java Array

Java Array: Find Mean

Here we will show an example of how to find the mean of a java integer array. The mean of an array is simply the average value of its sum. We sum up all the values of the array and divide it by the length of the java array.

Read More

Java Sum Array

By: Stephen Patrick | 25 May 2016 | Category: Java Array

Java Sum Array

Having previously talked about what an array is and some of the performance characteristics of a java array. Let's look at an example of how to sum the elements of a java array. To sum a java array in java we will write some code. Since we haven't discussed more advanced java language features such as generics etc in great detail we will keep the code as simple as possible.

Read More

Java Reverse Array

By: Stephen Patrick | 25 May 2016 | Category: Java Array

Java Reverse Array

Having previously talked about what an array is and some of the performance characteristics of a java array. Let's look at an example of how to reverse a java array. To reverse an array in java we will write some code. Since we haven't discussed methods, generics etc in great detail we will keep the code as simple as possible.

Read More

Java Array Performance

By: Stephen Patrick | 25 May 2016 | Category: Java Array

Java Array Performance

In previous sections we described what an array is in java. If we recall an array has a type, and every element in a java array has the same type. So every element in an array is of a certain type, but an array also has a length. In this sense if we have an array that has a length of five and has a type of integer we say that we have a fixed size array of five integers. Moreover, this array is five continuous memory address, that we can access individually using an index.

Read More

Java Array

By: Stephen Patrick | 25 May 2016 | Category: Java Array

Java Array

Java provides a data structure know as the array type. This is a basic data structure which is used as the basis of other data structures. The array type has some good performance characteristics for some operations and not so good performance for other behaviors.

Read More

Java Double Examples

By: Stephen Patrick | 25 May 2016 | Category: Java Type System

Java Double Examples

We previously looked at what a java double is including its specification and the min and max values that a variable of the java type double can hold. In this article we look at a few more examples of the java double type.

Read More

Java Double

By: Stephen Patrick | 25 May 2016 | Category: Java Type System

Java Double

The Double type in Java belongs to the java.lang package. Therefore, its fully qualified name is java.lang.Double. The java.lang prefix is known as a namespace, which we will talk about later. Moreover, when we declare a type of double we do not need to write an import statement within our code. The java compiler automatically imports the java.lang package (namespace for us).

Read More

Java Character Examples

By: Stephen Patrick | 25 May 2016 | Category: Java Type System

Java Character Examples

We previously explained the java character type and the specification of the java character type. In this section we will take a look at some examples of using the java character type.

Read More

Java Character Type

By: Stephen Patrick | 25 May 2016 | Category: Java Type System

Java Character Type

The java char type is used to hold character data. The java char type holds a single character within the java language. It can hold a single quoted character, or a character code. If the char variables holds an escaped character type it can be prefixed with a symbol.

Read More

Popular Articles