Byte_KeyWord

byte Keyword in Java with Examples

A byte is a Java primitive type.
This is a signed 8-bit type that has a range from –128 to 127.
Variables of type byte are especially useful when you’re working with a stream of data from a network or file.
There is Byte wrapper class represents primitive byte as an object.

byte Java Keyword Examples

Byte variables are declared by use of the byte keyword. For example, the following declares a byte variable called a:

byte a = 1;

The byte keyword can be used to the declared return type of a method as well:

public byte getByte() {
    return a;
}

Summary

  • A byte variable is signed 8-bit type that has a range from –128 to 127.
  • The Byte class is a wrapper class for the byte primitive type. It defines MIN_VALUE and MAX_VALUE constants representing the range of values for this type.
全部评论

相关推荐

纯真的河老师在喝茶:第一个是这个时间点岗位少,第二个是这个简历重复度太高了,10个有9个简历差不多的
点赞 评论 收藏
分享
秋招投简历提醒助手:个人经验是,一般面二十场左右就会进入侃侃而谈阶段。我今年七月末的时候开始的第一次面试,都是很多不会,回复很慢。后面慢慢迭代,到九月中的时候基本上面啥说啥,很放松的状态
远程面试的尴尬瞬间
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务