Program of declaration of variables in java, JAVA Programming

Program of Declaration of variables in Java

Program for declaring variables in Java, I've been trying so many codes for this but those codes didn't work well. Please write the code for declaring variable in java.

 

 

Posted Date: 2/11/2013 4:57:08 AM | Location : United States





You can try this example once. It will definitely work.

Program - Concept of Declaration of variables 

 class Variable_Concepts 

{  

       public static void Main () 

       { 

          char ch = ''A'';                          // Declaring a Character variable with value = ''A'' 

          byte a = 50;                          // Declaring a byte variable with value = 50 

          int b = 123456789;                // Declaring an Integer variable with value = 123456789 

          long c = 1234567654321;      // Declaring a Long type variable with value = 1234567654321 

         bool d = true;                       // Declaring a Boolean type variable with TRUE value 

         float e = 0.000000345F;        // Declaring a float type variable with value = 0.000000345. 

The value ends with a ''F'' resembeling a float data type

Float  f  =  1.23e5F;  //  Declaring a float  type exponential variable  with value = 1.23E5 = 123000.  The value contains the character ''e'' resembeling  an exponential value.Also,  the value ends  with a ''F'' resembeling a float data  type. 

       } 

}

Posted by Jacob | Posted Date: 2/11/2013 5:01:22 AM

Thank you for this code, it really works well, you are doing great job.

 

Posted by Archie | Posted Date: 2/11/2013 5:04:51 AM


Related Discussions:- Program of declaration of variables in java, Assignment Help, Ask Question on Program of declaration of variables in java, Get Answer, Expert's Help, Program of declaration of variables in java Discussions

Write discussion on Program of declaration of variables in java
Your posts are moderated
Related Questions
In this assignment, you are provided with an interface that contains a generic type. You are asked to create two classes that implement this interface. A. The Sequenced Interfac


what are the advantages of packages and interface? why we use them? and what is the way of using packages and interfaces complete description with examples?

Type casting defines treating a variable of one type as though it is another type. When up casting primitives as given below from left to right, automatic conversion happens. Bu

The significant methods of ActionForm are: validate () & reset ().

This exercise will give you some introductory exposure to network programming with sockets. Your task is to demonstrate a minimal server program and client program that can send on

need a java program that can read and display the values from a windows registry

State the significance of public, private, protected, default modifiers both singly and in combination and state the effect of package relationships on declared items qualified by

Relate Java with C/C++ Very similar C/C++ syntax, operators, etc. Core language is simpler than C++ -- no pointers, no operator overloading, and no multiple inheritance.

Write a java code to explain Else If ? if statements are not limited to two cases. You can merge an else and an if to form an else if and test a overall range of mutually exclu