首页 技术 正文
技术 2022年11月15日
0 收藏 765 点赞 4,333 浏览 1596 个字

这两天再看敏捷开发流程,我这个算是敏捷博客吗? 哈哈o(∩_∩)o

 package a.b; public class Three
{
static void Expression()
{
System.out.println("一、学习基本的表达式"); // 数学表达式
System.out.println( 1 + 2 ); //加法
System.out.println( 4 - 3.2 ); //减法
System.out.println( 7 * 1.5); //乘法
System.out.println( 29/7 ); //除法
System.out.println( 29%7 ); //求余 // 关系表达式
System.out.println(6 > 4.2); //大于
System.out.println(3.4 >= 3.4); //大于等于
System.out.println(1.5 < 9 ); //小于
System.out.println( 6 <= 1); // 小于等于
System.out.println(2 == 2); //等于
System.out.println(2 != 2 ); //不等于 /*
其他的一些表达式
true && false and
(3 > 1) || (2 == 1) or
!true not // 位运算
& and
| or
^ xor
~ not
5 << 3 0b101 left shift 3 bits
6 >> 1 0b110 right shift 1 bit m++ 变量m加1
n-- 变量n减1
condition ? x1 : x2 condition为一个boolean值。根据condition,取x1或x2的值
*/
} static void Controlstructure()
{
System.out.println("二、学习控制结构"); int a = 0; // 选择语句
if (a == 1)
{
System.out.println("学习if语句 if ");
}
else if (a == 0)
{
System.out.println("学习if语句 else if ");
}
else
{
System.out.println("学习if语句 else ");
} // 循环语句
while(a<3)
{
System.out.println("学习while语句"+a);
a++;
} do
{
System.out.println("学习do while语句"+a);
a++;
}while(a<6); // 使用break可以跳出循环、使用continue可以直接进入下一循环
for (int i = 0; i < 5; i++)
{
if (i == 1)
{
continue;
}
if (i == 4 )
{
break;
}
System.out.println("学习for语句"+i);
} // 选择语句
char c = 'b';
switch (c)
{
case 'a':System.out.println("学习swithch语句"+c); break;
case 'b':System.out.println("学习swithch语句"+c); break;
case 'c':System.out.println("学习swithch语句"+c); break;
default:System.out.println("学习swithch语句 default"); break;
}
} public static void main(String[] args)
{
// 学习基本的表达式
Expression(); // 学习控制结构
Controlstructure();
} }

运行结果如下:

一、学习基本的表达式
3
0.7999999999999998
10.5
4
1
true
true
true
false
true
false
二、学习控制结构
学习if语句 else if
学习while语句0
学习while语句1
学习while语句2
学习do while语句3
学习do while语句4
学习do while语句5
学习for语句0
学习for语句2
学习for语句3
学习swithch语句b
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,487
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,903
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,736
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,487
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,127
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,289