Notice: Constant WP_MEMORY_LIMIT already defined in /home/javawith/public_html/codesjava.com/wp-config.php on line 107

Notice: Constant WP_MAX_MEMORY_LIMIT already defined in /home/javawith/public_html/codesjava.com/wp-config.php on line 108
Byte data type in java - CodesJava

CodesJava

Easy learning with example program codes

Byte data type example in java


Notice: Undefined variable: footnotelist in /home/javawith/public_html/codesjava.com/wp-content/plugins/latex2html/inc/core.php on line 475

 
The byte data type represents an 8-bit signed two’s complement integer. Byte data type has a minimum value of -128 and a maximum value of 127 (inclusive).

Program to declare and use Java primitive byte variable.

/**
 * Program to declare and use Java primitive byte variable.
 * @author CodesJava
 */
public class DataTypeByteExample {	
  public static void main(String args[]){ 
	//Declare byte type variables.
	byte b1 = 100;
        byte b2 = 20;
 
        //Print variables value.
        System.out.println("b1 Value :" + b1);
        System.out.println("b2 Value :" + b2);
  }
}

Output:

b1 Value :100
b2 Value :20

 

Please follow and like us:
error
Posted in Java   

Core Java Tutorial








Copyright © 2019 CodesJava DMCA.com Protection Status