Java

35
2414 reads

January 29, 2013

instanceOf Operator


This example demonstrates the instanceOf operator which is very helpful in object oriented programming. It checks if a given object is instance of a given class.

24
2288 reads

January 29, 2013

Conditional Operator


This example demonstrates the conditional operator. How it works and the purpose of it.

22
2459 reads

January 29, 2013

Bitwise Operators


This example demonstrates the Bitwise operators in Java. And how they work and what they do.

48
2684 reads

January 28, 2013

Different way to print variables


This example demonstrates how to use the printf function which can be done in Java. But it is very famous in C. It can be handy for formatting string outputs.

60
2537 reads

January 28, 2013

Printing different values


This demonstrates the different types of variables that can be printed by Java's println function. And how it looks like in the screen.

55
2569 reads

January 28, 2013

Decimal Dropping


Here we demonstrate the importance when casting doubles to integers. What do we lose?

34
2691 reads

January 28, 2013

Scopes in Java


Program code is often split into various parts for various reasons. Usually, it is done by creating blocks of code using '{' and '}'. A block of code can exist inside another block of code.

24
4515 reads

January 28, 2013

Dynamic initialization in Java


Java allows us to perform 'dynamic initialization' of variables too.
What this means is that you can initialize variables using expressions (as will be seen in the example).

27
2535 reads

January 28, 2013

Creating variables in Java


Variables are a basic unit of data storage. A variable is defined by a data type and an identifier.

38
2260 reads

January 27, 2013