首页 > 其他分享 >3.10学习总结

3.10学习总结

时间:2023-03-10 22:37:22浏览次数:36  
标签:总结 3.10 System else 学习 print out 表达式 布尔

条件语句

public class Test { public static void main(String args[]){ int x = 10; if( x < 20 ){ System.out.print("这是 if 语句"); } } }

public class Test { public static void main(String args[]){ int x = 30; if( x < 20 ){ System.out.print("这是 if 语句"); }else{ System.out.print("这是 else 语句"); } } }

if(布尔表达式 1){ //如果布尔表达式 1的值为true执行代码 }else if(布尔表达式 2){ //如果布尔表达式 2的值为true执行代码 }else if(布尔表达式 3){ //如果布尔表达式 3的值为true执行代码 }else { //如果以上布尔表达式都不为true执行代码 }

public class Test { public static void main(String args[]){ int x = 30; if( x == 10 ){ System.out.print("Value of X is 10"); }else if( x == 20 ){ System.out.print("Value of X is 20"); }else if( x == 30 ){ System.out.print("Value of X is 30"); }else{ System.out.print("这是 else 语句"); } } }

if(布尔表达式 1){ ////如果布尔表达式 1的值为true执行代码 if(布尔表达式 2){ ////如果布尔表达式 2的值为true执行代码 } }

public class Test { public static void main(String args[]){ int x = 30; int y = 10; if( x == 30 ){ if( y == 10 ){ System.out.print("X = 30 and Y = 10"); } } } }

 

标签:总结,3.10,System,else,学习,print,out,表达式,布尔
From: https://www.cnblogs.com/clh628/p/17204825.html

相关文章

  • 3月10号总结
    1注解(1)注解(Annotation)也被称为元数据(Metadata),用于修饰包、方法、属性、构造器、局部变量等数据信息。(2)注解不影响程序逻辑,但注解可以被编译或运行。(3)在JavaSE中,......
  • m基于深度学习的OFDM信道估计和均衡算法误码率matlab仿真,对比了LS,MMSE以及LMMSE等传
    1.算法描述      随着无线通信的快速发展,5G正逐渐成长为支撑全社会各行业运作的大型基础性互联网络,其服务范围的大幅扩展对底层技术提出了诸多挑战,尤其是作为物......
  • 今日总结
    今天学习了javaservlet的知识JavaServlet是运行在Web服务器或应用服务器上的程序,它是作为来自Web浏览器或其他HTTP客户端的请求和HTTP服务器上的数据库或应用......
  • 2023.3.10每日总结
    web项目实现mysql增删改查并从前端页面操作 1.看下各个包下面的文件,我上一篇文章已经说过了,这里对上一章有一部分重复的2.User.java是数据库元素写的一个类,代码......
  • 20230310考试总结
    \(0h\)~\(0.5h\):大概将所有题目看了一下并且稍微想了一下T1,但没什么进展。\(0.5h\)~\(1.5h\):发现T3是求最大团的问题,直接打了随机化算法。\(1.5h\)~\(2h\)......
  • 每日总结-23.3.10
    <?xmlversion="1.0"encoding="utf-8"?><LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"android:orientation="horizontal"android:layout_w......
  • 每日总结 3.10
    今天学习了按键的操作。首先是按键的点击事件:packagecom.example.dongnao;importandroidx.appcompat.app.AppCompatActivity;importandroid.annotation.Suppress......
  • 每日学习总结_20230310
    今天学习了Android开发的基础知识,包括活动(Activity)、布局(Layout)、视图(View)等概念。还学习了如何创建一个简单的界面,使用XML进行布局,以及如何在Java代码中处理用户输入。明......
  • mysql锁总结
    概述:锁是在并发访问时,解决数据的有效性、一致性问题,有全局锁、表级锁、行级锁,锁粒度越小越好。全局锁:是对整个数据库实例加锁,一旦对整个数据库实例加了锁,那么就意味着这个......
  • 每日总结2023/3/10
    今天学习了AS中的复选框按钮效果如下  tv_text=findViewById(R.id.tv_text);bt_fa=findViewById(R.id.bt_fa);cb_sing=findViewById(R.id......