0% found this document useful (0 votes)
4 views1 page

Define and Output Variables Lab

Uploaded by

Raluca Bondoc
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views1 page

Define and Output Variables Lab

Uploaded by

Raluca Bondoc
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

A+ Computer Science VARIABLES LAB

Lab Goal : This lab was designed to teach you how to define and output a variable.

Lab Description : Define and print some variables.


Files Needed ::
[Link]
Lab Shell :
public class Variables
{
public static void main ( String[] args )
{
//define 1 variable of each of the
//following data types
//byte short int long
//float double
//char boolean String

//integer variables
byte byteOne = 127;

[Link]("/////////////////////////////////");
[Link]("*Some Person 07/18/02*");
[Link]("* *");
[Link]("* integer types *");
[Link]("* *");
[Link]("*8 bit - byteOne = "+byteOne+"\t\t*");
}
}

Sample Output :
/////////////////////////////////
*Some Person 07/18/02*
* *
* integer types *
* *
*8 bit - byteOne = 127 *
*16 bit - shortOne = -32123 *
*32 bit - intOne = 90877 *
*64 bit - longOne = 999999999 *
* *
* real types *
* *
*32 bit - floatOne = 38.5678 *
*64 bit - doubleOne = 923.234 *
* *
* other integer types *
* *
*16 bit - charOne = A *
* *
* other types *
* *
*booleanOne = true *
*stringOne = hello world *
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

© A+ Computer Science –Variables Output – [Link]

You might also like