代码语言
.
CSharp
.
JS
Java
Asp.Net
C
MSSQL
PHP
Css
PLSQL
Python
Shell
EBS
ASP
Perl
ObjC
VB.Net
VBS
MYSQL
GO
Delphi
AS
DB2
Domino
Rails
ActionScript
Scala
代码分类
文件
系统
字符串
数据库
网络相关
图形/GUI
多媒体
算法
游戏
Jquery
Extjs
Android
HTML5
菜单
网页交互
WinForm
控件
企业应用
安全与加密
脚本/批处理
开放平台
其它
【
Java
】
ISBN(国际标准书号)的校验
作者:
/ 发布于
2011/1/14
/
564
<div><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> Test { </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) { System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">9787302155638 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> ISBN.checkISBN(</span><span style="color: #000000">"</span><span style="color: #000000">9787302155638</span><span style="color: #000000">"</span><span style="color: #000000">)); System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">7564105607 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> ISBN.checkISBN(</span><span style="color: #000000">"</span><span style="color: #000000">7564105607</span><span style="color: #000000">"</span><span style="color: #000000">)); System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">730213880X </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> ISBN.checkISBN(</span><span style="color: #000000">"</span><span style="color: #000000">730213880X</span><span style="color: #000000">"</span><span style="color: #000000">)); System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">7302138800 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> ISBN.checkISBN(</span><span style="color: #000000">"</span><span style="color: #000000">7302138800</span><span style="color: #000000">"</span><span style="color: #000000">)); System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">9790000000000 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> ISBN.checkISBN(</span><span style="color: #000000">"</span><span style="color: #000000">9790000000000</span><span style="color: #000000">"</span><span style="color: #000000">)); </span><span style="color: #0000ff">try</span><span style="color: #000000"> { System.out.println(ISBN.checkISBN(</span><span style="color: #000000">"</span><span style="color: #000000">9770000000000</span><span style="color: #000000">"</span><span style="color: #000000">)); }</span><span style="color: #0000ff">catch</span><span style="color: #000000">(Exception e) { System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">9770000000000 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> e.getMessage()); } </span><span style="color: #0000ff">try</span><span style="color: #000000"> { System.out.println(ISBN.checkISBN(</span><span style="color: #000000">"</span><span style="color: #000000">123456545</span><span style="color: #000000">"</span><span style="color: #000000">)); }</span><span style="color: #0000ff">catch</span><span style="color: #000000">(Exception e) { System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">123456545 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> e.getMessage()); } } }</span> <span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">final</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> ISBN { </span><span style="color: #008000">/**</span><span style="color: #008000"> * 根据输入的ISBN号,检验ISBN的有效性。依据 GB/T 5795-2006 和 ISO 2108:2005 ISBN * 10位标准和13位标准实现(13位标准自2007年1月1日开始实行,在此之前采用10位标准)。 * * </span><span style="color: #808080">@param</span><span style="color: #008000"> String isbn:需要进行校验的ISBN字符串 * </span><span style="color: #808080">@return</span><span style="color: #008000"> true:所输入的ISBN校验正确;<br/> false:所输入的ISBN校验错误 </span><span style="color: #008000">*/</span><span style="color: #000000"> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">boolean</span><span style="color: #000000"> checkISBN(String isbn) { </span><span style="color: #0000ff">int</span><span style="color: #000000"> count </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; </span><span style="color: #0000ff">int</span><span style="color: #000000"> checkBitInt </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000"> 将ISBN数据全取大写字母 </span><span style="color: #008000">//</span><span style="color: #008000">isbn = isbn.toUpperCase();</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">char</span><span style="color: #000000">[] cs </span><span style="color: #000000">=</span><span style="color: #000000"> isbn.toCharArray(); </span><span style="color: #0000ff">switch</span><span style="color: #000000"> (isbn.length()) { </span><span style="color: #0000ff">case</span><span style="color: #000000"> </span><span style="color: #000000">10</span><span style="color: #000000">: </span><span style="color: #008000">//</span><span style="color: #008000"> **************************************************************** </span><span style="color: #008000">//</span><span style="color: #008000"> 当ISBN为10位时,进行的校验,用于2007年1月1日前的出版物 </span><span style="color: #008000">//</span><span style="color: #008000"> 数据格式:从左至右前9位为ISBN数据,第10位为校验位 </span><span style="color: #008000">//</span><span style="color: #008000"> 校验方法: </span><span style="color: #008000">//</span><span style="color: #008000"> (1) 从左至右将前9位数据从10开始至2进行编号,作为位权 </span><span style="color: #008000">//</span><span style="color: #008000"> (2) 将9位数据与各位位权进行加权,并求其9位和(称为加权和,记作M) </span><span style="color: #008000">//</span><span style="color: #008000"> (3) 第10位校验位计算方法,校验位为C: </span><span style="color: #008000">//</span><span style="color: #008000"> M + C ≡ 0 (mod 11) </span><span style="color: #008000">//</span><span style="color: #008000"> C为10时,记作“X” </span><span style="color: #008000">//</span><span style="color: #008000"> **************************************************************** </span><span style="color: #008000">//</span><span style="color: #008000"> 取出前9位数字进行加权和计算 </span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">9</span><span style="color: #000000">; i</span><span style="color: #000000">++</span><span style="color: #000000">) { </span><span style="color: #008000">//</span><span style="color: #008000"> 若前9位数据中有非数字字符,则抛出异常</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (cs[i] </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">0</span><span style="color: #000000">'</span><span style="color: #000000"> </span><span style="color: #000000">||</span><span style="color: #000000"> cs[i] </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">9</span><span style="color: #000000">'</span><span style="color: #000000">) { </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ISBNFormatException(</span><span style="color: #000000">"</span><span style="color: #000000">ISBN </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> isbn </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000"> 第 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> (i </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">) </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000"> 位中出现非法字符 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> cs[i]); } </span><span style="color: #0000ff">int</span><span style="color: #000000"> c </span><span style="color: #000000">=</span><span style="color: #000000"> cs[i] </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">0</span><span style="color: #000000">'</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000"> 求加权和</span><span style="color: #008000"> </span><span style="color: #000000"> count </span><span style="color: #000000">+=</span><span style="color: #000000"> c </span><span style="color: #000000">*</span><span style="color: #000000"> (</span><span style="color: #000000">10</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000"> i); } </span><span style="color: #008000">//</span><span style="color: #008000"> 取出校验位数据0~9和X符合校验字符要求</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (cs[</span><span style="color: #000000">9</span><span style="color: #000000">] </span><span style="color: #000000">>=</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">0</span><span style="color: #000000">'</span><span style="color: #000000"> </span><span style="color: #000000">&&</span><span style="color: #000000"> cs[</span><span style="color: #000000">9</span><span style="color: #000000">] </span><span style="color: #000000"><=</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">9</span><span style="color: #000000">'</span><span style="color: #000000">) { checkBitInt </span><span style="color: #000000">=</span><span style="color: #000000"> cs[</span><span style="color: #000000">9</span><span style="color: #000000">] </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">0</span><span style="color: #000000">'</span><span style="color: #000000">; } </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (cs[</span><span style="color: #000000">9</span><span style="color: #000000">] </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">X</span><span style="color: #000000">'</span><span style="color: #000000"> </span><span style="color: #000000">||</span><span style="color: #000000"> cs[</span><span style="color: #000000">9</span><span style="color: #000000">] </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">x</span><span style="color: #000000">'</span><span style="color: #000000">) { </span><span style="color: #008000">//</span><span style="color: #008000"> 校验位中的“X”表示数据“10”</span><span style="color: #008000"> </span><span style="color: #000000"> checkBitInt </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">10</span><span style="color: #000000">; } </span><span style="color: #0000ff">else</span><span style="color: #000000"> { </span><span style="color: #008000">//</span><span style="color: #008000"> 非0~9或X时抛出异常</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ISBNFormatException(</span><span style="color: #000000">"</span><span style="color: #000000">ISBN </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> isbn </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000"> 第 10 位中出现非法字符 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> cs[</span><span style="color: #000000">9</span><span style="color: #000000">]); } </span><span style="color: #008000">//</span><span style="color: #008000"> 进行校验</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> ((count </span><span style="color: #000000">+</span><span style="color: #000000"> checkBitInt) </span><span style="color: #000000">%</span><span style="color: #000000"> </span><span style="color: #000000">11</span><span style="color: #000000"> </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">) { </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000"> 校验成功</span><span style="color: #008000"> </span><span style="color: #000000"> } </span><span style="color: #0000ff">else</span><span style="color: #000000"> { </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000"> 校验失败</span><span style="color: #008000"> </span><span style="color: #000000"> } </span><span style="color: #0000ff">case</span><span style="color: #000000"> </span><span style="color: #000000">13</span><span style="color: #000000">: </span><span style="color: #008000">//</span><span style="color: #008000"> **************************************************************** </span><span style="color: #008000">//</span><span style="color: #008000"> 当ISBN为13位时,进行的校验,用于2007年1月1日后的出版物 </span><span style="color: #008000">//</span><span style="color: #008000"> 数据格式:从左至右前12位为ISBN数据,第13位为校验位 </span><span style="color: #008000">//</span><span style="color: #008000"> 校验方法: </span><span style="color: #008000">//</span><span style="color: #008000"> (1) 从左至右将前12位数的取其奇位数和和偶位数和 </span><span style="color: #008000">//</span><span style="color: #008000"> (2) 将偶位数和乘3,并其与奇位数和的和,得加权和 </span><span style="color: #008000">//</span><span style="color: #008000"> (3) 第13位校验位计算方法,校验位为C: </span><span style="color: #008000">//</span><span style="color: #008000"> M + C ≡ 0 (mod 10) </span><span style="color: #008000">//</span><span style="color: #008000"> **************************************************************** </span><span style="color: #008000">//</span><span style="color: #008000"> ISBN为13位数据时,前3位目前只能是“978”(已实行)或“979”(暂未实行)</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (</span><span style="color: #000000">!</span><span style="color: #000000">isbn.startsWith(</span><span style="color: #000000">"</span><span style="color: #000000">978</span><span style="color: #000000">"</span><span style="color: #000000">) </span><span style="color: #000000">&&</span><span style="color: #000000"> </span><span style="color: #000000">!</span><span style="color: #000000">isbn.startsWith(</span><span style="color: #000000">"</span><span style="color: #000000">979</span><span style="color: #000000">"</span><span style="color: #000000">)) { </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ISBNFormatException(</span><span style="color: #000000">"</span><span style="color: #000000">ISBN-13 格式不符合标准</span><span style="color: #000000">"</span><span style="color: #000000">); } </span><span style="color: #008000">//</span><span style="color: #008000"> 取出前12位数字进行加权和计算</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> countEven </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; </span><span style="color: #0000ff">int</span><span style="color: #000000"> countOdd </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; </span><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">12</span><span style="color: #000000">; i</span><span style="color: #000000">++</span><span style="color: #000000">) { </span><span style="color: #0000ff">int</span><span style="color: #000000"> c </span><span style="color: #000000">=</span><span style="color: #000000"> cs[i] </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">0</span><span style="color: #000000">'</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000"> 若前12位数据中有非数字字符,则抛出异常</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (c </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000"> </span><span style="color: #000000">||</span><span style="color: #000000"> c </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">9</span><span style="color: #000000">) { </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ISBNFormatException(</span><span style="color: #000000">"</span><span style="color: #000000">ISBN </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> isbn </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000"> 第 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> (i </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">) </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000"> 位中出现非法字符 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> cs[i]); } </span><span style="color: #008000">//</span><span style="color: #008000"> 分别计算奇位数和偶位数的和</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> ((i </span><span style="color: #000000">&</span><span style="color: #000000"> </span><span style="color: #000000">0x1</span><span style="color: #000000">) </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">) { countOdd </span><span style="color: #000000">+=</span><span style="color: #000000"> c; } </span><span style="color: #0000ff">else</span><span style="color: #000000"> { countEven </span><span style="color: #000000">+=</span><span style="color: #000000"> c; } } </span><span style="color: #008000">//</span><span style="color: #008000"> 求加权和</span><span style="color: #008000"> </span><span style="color: #000000"> count </span><span style="color: #000000">=</span><span style="color: #000000"> countOdd </span><span style="color: #000000">+</span><span style="color: #000000"> (countEven </span><span style="color: #000000">*</span><span style="color: #000000"> </span><span style="color: #000000">3</span><span style="color: #000000">); </span><span style="color: #008000">//</span><span style="color: #008000"> 取出校验位数据 </span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (cs[</span><span style="color: #000000">12</span><span style="color: #000000">] </span><span style="color: #000000"><</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">0</span><span style="color: #000000">'</span><span style="color: #000000"> </span><span style="color: #000000">||</span><span style="color: #000000"> cs[</span><span style="color: #000000">12</span><span style="color: #000000">] </span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">9</span><span style="color: #000000">'</span><span style="color: #000000">) { </span><span style="color: #008000">//</span><span style="color: #008000"> 校验位为非0~9字符时,抛出异常</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ISBNFormatException(</span><span style="color: #000000">"</span><span style="color: #000000">ISBN </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> isbn </span><span style="color: #000000">+</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000"> 第 13 位中出现非法字符 </span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">+</span><span style="color: #000000"> cs[</span><span style="color: #000000">12</span><span style="color: #000000">]); } checkBitInt </span><span style="color: #000000">=</span><span style="color: #000000"> cs[</span><span style="color: #000000">12</span><span style="color: #000000">] </span><span style="color: #000000">-</span><span style="color: #000000"> </span><span style="color: #000000">'</span><span style="color: #000000">0</span><span style="color: #000000">'</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000"> 进行校验</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> ((count </span><span style="color: #000000">+</span><span style="color: #000000"> checkBitInt) </span><span style="color: #000000">%</span><span style="color: #000000"> </span><span style="color: #000000">10</span><span style="color: #000000"> </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">) { </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000"> 校验成功</span><span style="color: #008000"> </span><span style="color: #000000"> } </span><span style="color: #0000ff">else</span><span style="color: #000000"> { </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">; </span><span style="color: #008000">//</span><span style="color: #008000"> 校验失败</span><span style="color: #008000"> </span><span style="color: #000000"> } </span><span style="color: #0000ff">default</span><span style="color: #000000">: </span><span style="color: #008000">//</span><span style="color: #008000"> ISBN为非10位或13位时抛出异常</span><span style="color: #008000"> </span><span style="color: #000000"> </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ISBNFormatException(</span><span style="color: #000000">"</span><span style="color: #000000">ISBN 格式不符合标准</span><span style="color: #000000">"</span><span style="color: #000000">); } } }</span> <span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> ISBNFormatException </span><span style="color: #0000ff">extends</span><span style="color: #000000"> RuntimeException { </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">final</span><span style="color: #000000"> </span><span style="color: #0000ff">long</span><span style="color: #000000"> serialVersionUID </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">1L</span><span style="color: #000000">; </span><span style="color: #0000ff">public</span><span style="color: #000000"> ISBNFormatException() { </span><span style="color: #0000ff">super</span><span style="color: #000000">(</span><span style="color: #000000">"</span><span style="color: #000000">ISBN Error ...</span><span style="color: #000000">"</span><span style="color: #000000">); } </span><span style="color: #0000ff">public</span><span style="color: #000000"> ISBNFormatException(String arg0) { </span><span style="color: #0000ff">super</span><span style="color: #000000">(arg0); } }</span> </div>
试试其它关键字
ISBN
同语言下
.
List 切割成几份 工具类
.
一行一行读取txt的内容
.
Java PDF转换成图片并输出给前台展示
.
java 多线程框架
.
double类型如果小数点后为零则显示整数否则保留两位小
.
将图片转换为Base64字符串公共类抽取
.
sqlParser 处理SQL(增删改查) 替换schema 用于多租户
.
JAVA 月份中的第几周处理 1-7属于第一周 依次类推 29-
.
java计算两个经纬度之间的距离
.
输入时间参数计算年龄
可能有用的
.
C#实现的html内容截取
.
List 切割成几份 工具类
.
SQL查询 多列合并成一行用逗号隔开
.
一行一行读取txt的内容
.
C#动态修改文件夹名称(FSO实现,不移动文件)
.
c# 移动文件或文件夹
.
c#图片添加水印
.
Java PDF转换成图片并输出给前台展示
.
网站后台修改图片尺寸代码
.
处理大图片在缩略图时的展示
贡献的其它代码
Label
Copyright © 2004 - 2024 dezai.cn. All Rights Reserved
站长博客
粤ICP备13059550号-3