Wednesday, November 25, 2015

How To Use Variables In Java Programs Post 9

Hi All...!

Today I'm going to teach you how to work with char data type. char is 16 bit data type if you are not familiar with char data type please read 8 Basics topic.

Let's get to coding,

Declare and initialize char variable,

There are number of way to declare and initialize char variables but I'm going to show you the most commonly using ways,

We can directly assign single character to char variable, here we have to write that character in side the single quotation marks.




The other way is using "ASCII" codes we can also initialize the char variables, when we use ascii codes we don't want to use single quotation marks.




ASCII code table is given below




Another way to initialize char variables is using unicodes,



Following is table of some unicodes,



See you guys on my next post bye...!

Tuesday, November 10, 2015

How To Use Variables In Java Programs Post 8

Hi All...!

First of all I would like to say Sorry for not publishing post for month. Today I'm going to teach you how to use boolean data type in Java. boolean is one of a 8 basics, boolean data type only can hold two type of data "true" or "false". boolean data type is very useful when we us "if" conditions in Java to make decisions. In future posts I will teach you what are the if conditions and how to use them to decision making programs. Now just learn how to declare and initialize variables using boolean data type.

Let's do coding...!




As I shown in above two codes we can directly assign "true" and "false" values to boolean variable, There are another way to assign these two values to boolean variable we can use mathematical condition to assign "true" or "false" value to boolean variable.

Let's learn how to use mathematical conditions,