Java Type System

Java Type System

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

Java Type System

The type system of any programming language is the different types of data it can store. More specifically it gives labels to the different types of data elements, the range of values it can store, and the relationship between them. Programming languages can be generally divided into two different type systems.

Read More

Java Autoboxing

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

Java Autoboxing

The Java Type System, can be divided into two main data types namely, primitive and reference types. Java is a rich type system and we normally create our own custom types (reference types) that extend from java.lang.Object.

Read More

Java Autoboxing Caveats

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

Java Autoboxing Caveats

As we talked about Autoboxing and Unboxing were introduced into the Java Language in Java 1.5. Autoboxing and Unboxing provides Syntactic Sugar to the java language by automatically converting between primitive to reference type and vice a versa respectively.

Read More

Java Bitwise Operators

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

Java Bitwise Operators

Bitwise operation is an operation that requires the operand(s) of the operation to be in binary format (bytes), and applies the operation one bit at a time. If you remember a byte is 8 bits, where a bit can have a value of 0 or 1.

Read More

Java BitShift Operators

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

Java BitShift Operators

Bitshift operation is an operation that requires the operand(s) of the operation to be in binary format (bytes), and applies the operation one bit at a time. If you remember a byte is 8 bits, where a bit can have a value of 0 or 1.

Read More

Java Floating Point Precision Caveat

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

Java Floating Point Precision Caveat

Out of the box two of Javas primitive types for representing decimal values are the types float and double. These types implement the IEEE Standard for Floating-Point Arithmetic (IEEE 754) specification. However using these types can lead to issues that you should be aware of.

Read More

Java Integer

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

Java Integer

The Integer data type in Java belongs to the java.lang package. This package is indirectly imported by the Java compiler so you don't have to. Like other, numerical types the Integer class extends from the java.lang.Number class, which like every class in the Java ecosystem extends from java.lang Object.

Read More

Integer From String Examples

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

Integer From String Examples

Here we will look at some more examples of the Integer Data Type and how to convert an integer from a string. The Integer data type in Java belongs to the java.lang package. This package is indirectly imported by the Java compiler so you don't have to. As mentioned in the previous article the integer type comes into two many forms the primitive int type and the reference type java.lang.Integer.

Read More

Java Integer Examples

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

Java Integer Examples

Here we will look at a few more examples of Integers. To convert an integer to a java.lang.String we can use the toString() method. The toString() method is common to all classes in the Java ecosystem. It is inherited from java.lang.Object.

Read More

Java Integer Numeric Conversion

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

Java Integer Numeric Conversion

In previous examples we looked at what Java integers are, we also looked at some java integer examples. In this article we look at how to convert Java integers to other numeric primitive types.

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

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