随笔分类 -  java程序开发

摘要:package com.chongrui.test;/* *使用FOR做九九税法表 * * * */public class test { public static void main(String[] args) { // TODO Auto-generated method stub //外层 阅读全文
posted @ 2017-01-01 18:03 tantanba 阅读(110) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/* *使用while循环遍历数组 * * * */public class test { public static void main(String[] args) { // TODO Auto-generated method stub St 阅读全文
posted @ 2017-01-01 17:34 tantanba 阅读(988) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/* * for(元素变量x:遍历对象obj){ * 引用X的java语句 * * } * * * */public class test { public static void main(String[] args) { // TODO Aut 阅读全文
posted @ 2017-01-01 17:26 tantanba 阅读(210) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/*while语句的一般形式如下:while(表达式)语句表达式为非0值,执行while中内嵌语句.它是先判断表达式,在根据表达式值,执行语句.do_while语句的一般形式如下:do循环体语句while(表达式);它的特点是先执行循环体语句,然后 阅读全文
posted @ 2017-01-01 16:34 tantanba 阅读(156) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/*while用法一例 * *///import java.util.Scanner;public class TypeConvertion { public static void main(String[] args){ //public st 阅读全文
posted @ 2016-12-27 23:32 tantanba 阅读(129) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/*为新员工分配部门 * */import java.util.Scanner;public class TypeConvertion { public static void main(String[] args){ Scanner scan = 阅读全文
posted @ 2016-12-27 23:11 tantanba 阅读(256) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/*验证信息登陆的合法性 * */import java.util.Scanner;public class TypeConvertion { public static void main(String[] args){ Scanner scan 阅读全文
posted @ 2016-12-27 22:49 tantanba 阅读(125) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/*运用SWITCH语句打印星期几的单词 * */ public class TypeConvertion { public static void main(String[] args){ System.out.println("今天星期几"); 阅读全文
posted @ 2016-12-27 17:26 tantanba 阅读(326) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2016-12-27 17:13 tantanba 阅读(197) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/* 声明两个变量并赋值计算出矩形的面积 * */ public class TypeConvertion { public static void main(String[] args){ double x = 3.5; double y = 1 阅读全文
posted @ 2016-12-27 17:06 tantanba 阅读(257) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/* * 不用*用移位运算符计算21*16的数值是多少 * java中有三种移位运算符 << : 左移运算符,num << 1,相当于num乘以2 >> : 右移运算符,num >> 1,相当于num除以2 >>> : 无符号右移,忽略符号位,空位 阅读全文
posted @ 2016-12-27 16:28 tantanba 阅读(959) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/* * 经典实例,计算球形的面积和体积 * 面积和体积的公式:v3=4.0/3.0*PI*r*r*r s2=4.0*PI*r*r * * */import java.util.Scanner;public class TypeConvertion 阅读全文
posted @ 2016-12-27 15:46 tantanba 阅读(999) 评论(0) 推荐(0)
摘要:package com.chongrui.test;/* * 经典实例,判断那一条是闰年 * 闰年的定义:如果被4整除且不能补100整除或者被400整除则该年是闰年 * * */import java.util.Scanner;public class TypeConvertion { public 阅读全文
posted @ 2016-12-26 00:30 tantanba 阅读(179) 评论(0) 推荐(0)
摘要:package com.chongrui.test; public class TypeConvertion { public static void main(String[] args) { // TODO Auto-generated method stub int intNum = 3; f 阅读全文
posted @ 2016-12-26 00:15 tantanba 阅读(139) 评论(0) 推荐(0)
摘要:package com.chongrui.test;//运用三目运算符及扫描器实现输入判断奇偶数import java.util.Scanner;public class test { public static void main(String[] args){ Scanner scan = ne 阅读全文
posted @ 2016-12-24 21:29 tantanba 阅读(331) 评论(0) 推荐(0)
摘要:package com.chongrui.test;//不用其它变量进行变量互换import java.util.Scanner; //导入扫描器public class test { public static void main(String[] args){ Scanner scan = ne 阅读全文
posted @ 2016-12-24 21:02 tantanba 阅读(129) 评论(0) 推荐(0)
摘要:package com.chongrui.test;//测试全局变量及局部变量的输出结果的异同public class Gess { static int times = 1; public static void main (String[] args){ int times = 4; int t 阅读全文
posted @ 2016-12-24 17:43 tantanba 阅读(145) 评论(0) 推荐(0)
摘要:逻辑运算符及按位或与非比较难理解先放着87 阅读全文
posted @ 2016-12-24 17:31 tantanba 阅读(164) 评论(0) 推荐(0)
摘要:package com.chongrui.test;//测试全局变量及局部变量的输出结果的异同,成员变量如果与局部变量相同,暂时是失效的,如果要调用成员变量需要:类名+变量名public class Gess { static int times = 1; //定义成员变量 public stati 阅读全文
posted @ 2016-12-24 17:06 tantanba 阅读(162) 评论(0) 推荐(0)
摘要:编写转义字符:78页 system.out.println("\\") 输出\ package com.chongrui.test; public class Gess { public static void main(String[] args) { // TODO Auto-generated 阅读全文
posted @ 2016-12-19 23:40 tantanba 阅读(137) 评论(0) 推荐(0)