
java基础
文章平均质量分 53
one-sided
渣渣程序员的蜗牛之路,哎呦妈耶,语言组织能力不行,谅解谅解,同时,欢迎批评但无脑指责请绕道。
展开
-
java判断回文的两种方法
第一种:面向过程:从字符串Str.length()/2开始向两端移动进行对比 ,boolean用来确定一个返回值判断是否回文Scanner input = new Scanner(System.in); try{ System.out.println("Enter a three-digit interger:"); String integer = input.next(); i...原创 2018-03-17 19:51:55 · 21620 阅读 · 3 评论 -
java复制数组的三种方法
第一种:使用循环语句逐个复制数组元素int[] scoureArray = {2,3,1,5,10};int[] targeArray = new int[soureArray.length];for(int i = 0;i<sourceArray.length;i++){targeArray[i] = sourceArray[i];}第二种:使用java.lang.System类中的arr...原创 2018-04-02 09:27:23 · 3190 阅读 · 0 评论 -
java中的取整方法
ceil(x):向上取整;floor(x):向下取整;rint(x):取最接近的整数,如果距离相等,则取偶数;例:rint(2.5)取整 为2.0round(x):如果是单精度:返回(int)Math.floor(x+0.5) 如果是双精度:返回(long)Math.floor(x+0.5) 例如:Math.round(2...原创 2018-04-12 17:56:48 · 6843 阅读 · 0 评论 -
java中Character类中的方法
isDigit(ch): 如果指定的字符是一个数字,返回true;isLetter(ch): 如果指定的字符是一个字母,返回true;isLetterOrDigit(ch):如果指定的字符是一个字母或者数字,返回true;isLowerCase(ch): 如果指定的字符是一个小写字母,返回true;isUpperCase(ch): 如果指定的字...原创 2018-04-12 18:04:56 · 1263 阅读 · 1 评论 -
switch case 中判断出现int无法转换为boolean问题(已解决)
在写java中,出现使用switch case时报错,显示“java:不兼容类型,int 无法转换为bolean”,在拒绝修改为if-else 语句后,根据switch case 的基本原理找出了修改方法:首先,先让我们来了解一下switch case:switch 语句由一个判断条件或者是一个变量和多个case语句以及最后的default组成。switch (变量/判断条件){ ...原创 2018-07-19 20:32:30 · 7156 阅读 · 0 评论 -
Java:类与继承
http://www.cnblogs.com/dolphin0520/p/3803432.html转载 2018-07-25 14:38:43 · 205 阅读 · 0 评论 -
写jsp时出现类型object不匹配问题(未解决)
user=[object%20HTMLInputElement] 400 ()在简单的 用户输入验证问题中,尝试使用javaScript,ajax,等方法进行验证,使用javaScript出现问题$("#user").blur(function() { //获取发送请求的核心对象 ajax=new XMLHttpRequest(); ...原创 2018-08-09 16:12:58 · 834 阅读 · 0 评论