Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
Java All : Data Types, Variables and Constants
Concept Notes and Resources
Concept Learning Code Sheets
Variable Declaration and Initialisation #3862 

Variable declaration and initialisation varieties are explained here.

Understanding double and float data type #3840 

Double and float data type declaration its max value and sizing.

Understanding byte, short, int and long types #3846 

Different types of integer data types with its maximum and minimum value limits are explained with this code.

Understanding char data type #3848 

The java char data type and its possible values are explained here.

Understanding boolean data type #3850 

The java boolean data type declaration and its features.

Understanding Reference data type #3859 

Reference data type for class object reference and array reference.

Variable Kinds – Local, Class and Instance Variables #3865 

Mainly used kinds Local, Class and Instance Variables are discussed here.

Variable Default Values #3867 

Java class variables have default values. Let us experiment with that.

Resolving Class and Local Variable Name Clash #3871 

Methods to rightly use variable names when their names clash between class/static types and local types.

Variable Scope #575 

This is a program that will tell you about the scope of variables in different parts of programs.

Getting size of Primitive data types #565 

Outputs the size of the eight primitive data types present in java.

Sum and Difference of two numbers #569 

Gives you understanding of declaration along with dynamic initialization

Product and Division of two numbers #571 

Product and Division to show data type compatibility difference.

Average of two double numbers #573 

Finding average of two double numbers.

Printing Ascii Codes as Characters Alphabets & Digits #3512 

Printing uppercase alphabets, lowercase alphabets, digits by printing them as characters typecasted from its integer form ascii values.

Solved Problems
Output writing based on summation of different data types. #3852 

Write output of the following program which is based on summation of different data types.

class SP_DataSum
{
  public static void main(String[] args)
  {
    int n=12;
    double d=12.0;
    float f=12.0f;
    byte b=12;
    char c=12;
    System.out.println(n+d+f+b+c);
  }
}

 

Write output of the following program which is based on summation of different data types. ...
Output writing for Data Type Size #3857 

Find output of following data type size determination instructions using wrapper class declarations.

Integer n=12;
Double d=12.0;
Float f=12.0f;
Character c=12;
Short s=12;
Long l=12L;
Byte b=12;
System.out.println(n.SIZE);
System.out.println(d.SIZE);
System.out.println(f.SIZE);
System.out.println(c.SIZE);
System.out.println(s.SIZE);
System.out.println(l.SIZE);
System.out.println(b.SIZE);

Find output of following data type size determination instructions using wrapper class dec ...
Data type selection #3873 

Write a program to initialise a variable with price of an item as a fractional value. Then prepare another variable to output the price multiplied with 100 so that its lowest currency denomination (LCD) value is achieved. Print the LCD price with a suitable message. Choose appropriate variable names and data types.

Write a program to initialise a variable with price of an item as a fractional value. Then ...
Data default values Viva-question #3875 

Why do we need to initialise local variables when we have default values specified for all primitive data types.

Why do we need to initialise local variables when we have default values specified for all ...
Float f suffix Viva-question #3880 

Why do we add f suffix to a decimal literal number when we initialise a float variable.

Why do we add f suffix to a decimal literal number when we initialise a float variable. ...
Output Writing – Implicit conversion #7229 

Write the output:
char ch = ‘F’;
int m = ch;
m=m+5;
System.out.println(m + ” ” + ch);

Write the output: char ch = 'F'; int m = ch; m=m+5; System.out.println(m + " " + ch); ...
Exam Questions
ICSE2014-03A  Identifying Composite Data Types #3887 

List the variables from those given below that are composite data types.
(i) static int x;
(ii) arr[i] = 10;
(iii) obj.display();
(iv) boolean b;
(v) private char chr;
(vi) String str;

List the variables from those given below that are composite data types. (i) static int x ...
ICSE2014-01C  Identifying Data Types #3901 

Name the primitive data type in Java that is:
(i) a 64-bit integer and is used when you need a range of values wider than those provided by int.
(ii) a single 16-bit Unicode character whose default value is ‘u0000′

Name the primitive data type in Java that is: (i) a 64-bit integer and is used when you n ...
ICSE2015-01A  Default Values #3926 

What are the default values of the primitive datatypes int and float?

What are the default values of the primitive datatypes int and float? ...
ICSE2015-02B  Primitive Data Type Sizes #3962 

Arrange the following primitive data types in an ascending order of their size:
(i) char (ii) byte (iii) double (iv) int

Arrange the following primitive data types in an ascending order of their size: (i) char ...
ICSE2018-02A  ascii value of character #4035 

(1) int res = ‘A’;
What is the value of res?

(ii) Name the package that contains wrapper classes.

(1) int res = 'A'; What is the value of res? (ii) Name the package that contains wrapp ...
ICSE2017-01C  data type size #4102 

State the number of bytes occupied by char and int data types.

State the number of bytes occupied by char and int data types. ...
ICSE2016-02B  casting types identification #4223 

What are the types of casting shown by the following examples:
(i) char c = (char)120;
(ii) int x = ‘t’;

What are the types of casting shown by the following examples: (i) char c = (char)120; ( ...
Quizzes

Concept Notes:1  Code Sheets:15  Solved Problems:6  Exam Questions:10  Quizzes:7
Back