Searching...
Tuesday, 23 July 2013

Java data-types

Java Data-types:

In Java every variable, expression has a type and all assignments are checked by compiler for type compatibility. Therefore java is treated as strongly typed language
Except boolean and char the remaining datatypes are considered as signed datatypes.


1.       byte: Range from -128 to 127
+ve numbers are represented directly in memory, -ve are represented as 2s compliment.
Example:
1.       byte b=10
2.       byte b=130 compile time error. Possible loss of precision required byte found int

2.       short: Range from -32768 to 32767
3.       integer:
Example
int x=0;
if (x)
{
        Sopln(“Hello”);
}
Else
{
        Sopln(“Hi”);
}
Compile time error: incompatible types found: int required: boolean
4.       char literal :
Example:
char ch=’a’;   correct
char ch=a; compile time error
char ch=’ab’; unclosed character literal
char ch=”ab”; incompatible types



3 comments:

  1. Consequently, they constructed a JavaScript plan, called as “JavaScriptTestRunner” in earlier 2004 that may instantly manage the browser’s steps which appeared greatly much like that of the person speaking using the visitor.

    Henceforth, Jason began demoing the device towards the huge viewers. Fundamentally the conversations were organized to classify this device in the wild resource class in addition to its possible to develop like a re usable screening framework regarding additional internet based programs.

    ReplyDelete
  2. Resizing a net factor applying movebyoffset
    Typically if ever we should adjust how big is a feature we do with all the help of mouse personally. Currently we will see to resize OR alter how big is an element applying webdriver steps class with moveByOffset which moves the mouse position from its recent location from the provided offset
    . For more info on this see here

    ReplyDelete
  3. The Java data types explanation is exemplary. It covers primitive and reference types with clarity, aiding developers in understanding the nuances of each. The App Download The concise examples and comparisons provide a strong foundation.

    ReplyDelete

 
Back to top!