摘要: package com.chongrui.test;/*运用SWITCH语句打印星期几的单词 * */ public class TypeConvertion { public static void main(String[] args){ System.out.println("今天星期几"); 阅读全文
posted @ 2016-12-27 17:26 tantanba 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-12-27 17:13 tantanba 阅读(189) 评论(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 阅读(243) 评论(0) 推荐(0) 编辑
摘要: package com.chongrui.test;/* * 不用*用移位运算符计算21*16的数值是多少 * java中有三种移位运算符 << : 左移运算符,num << 1,相当于num乘以2 >> : 右移运算符,num >> 1,相当于num除以2 >>> : 无符号右移,忽略符号位,空位 阅读全文
posted @ 2016-12-27 16:28 tantanba 阅读(906) 评论(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 阅读(912) 评论(0) 推荐(0) 编辑
摘要: package com.chongrui.test;/* * 经典实例,判断那一条是闰年 * 闰年的定义:如果被4整除且不能补100整除或者被400整除则该年是闰年 * * */import java.util.Scanner;public class TypeConvertion { public 阅读全文
posted @ 2016-12-26 00:30 tantanba 阅读(171) 评论(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 阅读(130) 评论(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 阅读(297) 评论(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 阅读(125) 评论(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 阅读(135) 评论(0) 推荐(0) 编辑