Home > Java > Java – Data types / Type casting /

Java – Data types / Type casting /

Data types

Logical: boolean  true/false

Number: byte, short, int, long

Decimal: float, double

Character: char, string

char a = ‘A’ ; // note char inserted using single quotes

enummeration: enum

example: enum shamunExpert { java, centos, php, mysql, networking }

Iwant iw = shamunExpert.java;

constanten: final int abc = 10;

* things to note:

String name; we didnt reserved any memory yet.

myname = new Coordinaat(); // the new will use memory bytes

* type literal

String myname= “Hello there”;

*simple ++ | —

int i = 2;

int j = i++ * 3 ; // j = 6

int j = ++i * 3; // where j = 4 * 3

Advertisements
Categories: Java
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: