当前位置:   article > 正文

java语言程序设计基础篇第十章答案_java语言程序设计基础篇第十章第三题参看答案...

java web第十章第三题课后答案

10.3 /*

* To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates

* and open the template in the editor.

*/

/**

*

* @author Administrator

*/

class MyInteger{

int value;

String value1;

MyInteger(int value){

this.value=value;

}

MyInteger(String value1){

this.value1=value1;

}

int getValue(){

return value;

}

boolean isEven(){

return value%2==0?true:false;

}

boolean isOdd(){

return value%2!=0?true:false;

}

boolean isPrime(){

for(int i=2;iif (value%i!=0)

return true;

return false;

}

boolean isEven(int value){

this.value=value;

return value%2==0?true:false;

}

boolean isOdd(int value){

this.value=value;

return value%2!=0?true:false;

}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/木道寻08/article/detail/798227
推荐阅读
相关标签
  

闽ICP备14008679号