Long valueOf(String s, int radix)、Long valueOf(String s)区别于用法

Long valueOf(String s,int radix) 与 Long valueOf(String s)这两个重载方法,是
包装类Long 中的两个static 静态方法,基本的功能都是将参数String s 转换为对应的long型数(实际上是直接转换为Long 类型的数,然后因为自动拆箱的存在,可以直接当做long型数据来使用)。

具体的使用细则如下:
(1)valueOf(String s,int radix)
中文版的API中是下面这么说明的:
在这里插入图片描述
即:

public static Long valueOf(String s,
int radix)
throws NumberFormatException返回一个Long对象,该对象保存从指定的String String的值,并用第二个参数给出的基数进行解析。 第一个参数被解释为在第二个参数指定的基数中表示一个签名的long ,就好像参数被赋予parseLong(java.lang.String, int)方法一样。 结果是一个Long对象,表示由字符串指定的long值。
换句话说,该方法返回一个Long对象的值等于:
new Long(Long.parseLong(s, radix))
参数
s - 要解析的字符串
radix - 用于解释的基数 s
结果
一个保存由指定基数中的字符串参数表示的值的 Long对象。
异常
NumberFormatException - 如果 String不包含可解析的 long 。

英文版的API说明如下:
在这里插入图片描述

即:

public static Long valueOf(String s,
int radix)
throws NumberFormatException
Returns a Long object holding the value extracted from the specified String when parsed with the radix given by the second argument. The first argument is interpreted as representing a signed long in the radix specified by the second argument, exactly as if the arguments were given to the parseLong(java.lang.String, int) method. The result is a Long object that represents the long value specified by the string.
In other words, this method returns a Long object equal to the value of:
new Long(Long.parseLong(s, radix))
Parameters:
s - the string to be parsed
radix - the radix to be used in interpreting s
Returns:
a Long object holding the value represented by the string argument in the specified radix.
Throws:
NumberFormatException - If the String does not contain a parsable long.


(2)valueOf(String s)
中文版的API中是这么说明的:
在这里插入图片描述
即:

public static Long valueOf(String s)
throws NumberFormatException返回一个Long指定的Long的值的Long String 。
该参数被解释为表示一个有符号的十进制long ,正如参数被赋予parseLong(java.lang.String)方法一样。 结果是一个表示由字符串指定的整数值的Long对象。
换句话说,此方法返回一个Long对象的值等于:
new Long(Long.parseLong(s))
参数
s - 要解析的字符串。
结果
一个保存由string参数表示的值的 Long对象。
异常
NumberFormatException - 如果字符串不能被解析为 long 。

英文版的API如下:
在这里插入图片描述
即:

public static Long valueOf(String s)
throws NumberFormatException
Returns a Long object holding the value of the specified String. The argument is interpreted as representing a signed decimal long, exactly as if the argument were given to the parseLong(java.lang.String) method. The result is a Long object that represents the integer value specified by the string.
In other words, this method returns a Long object equal to the value of:
---->new Long(Long.parseLong(s))
Parameters:
s - the string to be parsed.
Returns:
a Long object holding the value represented by the string argument.
Throws:
NumberFormatException - If the string cannot be parsed as a long.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
著名培训机构的LTE培训教材。 深入浅出,从基本概念到深入描述。是一份比较全面的教材。全文367页。有料有内容。是一份难得的教材。 文件比较大,所以拆成3部分。这是part2 LTE from A-Z Technology and Concepts of the 4G 3GPP Standard Table of Content Principles and Motivation of LTE............................................1 1.1 Mobile Radio: Comparison between 3G and 4G..................2 1.1.1 Performance and Mobility Management related Issues..............2 1.1.2 Architecture related Issues..........................................................4 1.1.3 Procedure and Radio related Issues...........................................6 1.2 Requirements on LTE............................................................8 1.2.1 General Requirements................................................................8 1.2.1.1 Support of Enhanced Quadruple Play Services............................10 1.2.1.2 Very High Data Rates @ flexible bandwidth deployment ((1.25) 5 – 20 MHz).....................................................................................................10 1.2.1.3 AIPN and PS services only............................................................10 1.2.2 Important Characteristics of LTE Physical Layer.......................12 1.2.2.1 General Physical Layer Characteristics.........................................12 1.2.2.1.1 OFDM ..................................................................................12 1.2.2.1.2 Scalable Bandwidth..............................................................13 1.2.2.1.3 Smart Antenna Technology..................................................14 1.2.2.1.4 Fast scheduling and AMC.....................................................14 1.2.2.1.5 No Soft(er) handover............................................................14 1.2.3.2 OFDM/OFDMA..............................................................................16 1.2.3.2.1 Traditional narrowband communication................................16 1.2.3.2.2 Problems for wideband signals.............................................1

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值