java练习---7
//程序员:罗元昊 2017.10.7
import java.util.Scanner;
public class L { public static void main(String[] args) {
System.out.println("5+5="++); int a=,b;
b=a++;
System.out.println("a="+a+",b="+b); short c=;
c=(short) (c+);
System.out.println("c="+c); short d=;
d+=;
System.out.println("d="+d); System.out.println(&);
System.out.println(|);
System.out.println(^);
System.out.println(<<);
System.out.println(>>); int e=,f;
f=e>?:;
System.out.println("f="+f); @SuppressWarnings("resource")
Scanner input=new Scanner(System.in);
int g,h;
System.out.println("Enter the g ");
g=input.nextInt();
System.out.println("Enter the h ");
h=input.nextInt();
h=g>h?g:h;
System.out.println("The larger of the two numbers is"+h); @SuppressWarnings("resource")
Scanner input1=new Scanner(System.in);
int x,y,z;
System.out.println("Enter the x ");
x=input1.nextInt();
System.out.println("Enter the y ");
y=input1.nextInt();
System.out.println("Enter the z ");
z=input1.nextInt();
y=x>y?x:y;
z=y>z?y:z;
System.out.println("The largest of the three numbers is"+ z); @SuppressWarnings("resource")
Scanner input11=new Scanner(System.in);
int month;
System.out.println("Enter the month ");
month=input11.nextInt();
if(month>=&&month<=){
System.out.println("This month is spring");
}
else if(month>=&&month<=){
System.out.println("This month is summer");
}
else if(month>=&&month<=){
System.out.println("This month is autumn");
}
else if(month==){
System.out.println("This month is winter");
}
else if(month>=&&month<=){
System.out.println("This month is winter");
}
else{
System.out.println("Error!");
} @SuppressWarnings("resource")
Scanner input111=new Scanner(System.in);
int month1;
System.out.println("Enter the month ");
month1=input111.nextInt();
switch (month1)
{
case : case : case :
System.out.println("This month is winter");
break;
case : case : case :
System.out.println("This month is spring");
break;
case : case : case :
System.out.println("This month is summer");
break;
case : case : case :
System.out.println("This month is autumn");
break;
default:
System.out.println("Error!");
break;
} int i=;
do{
System.out.println("i="+i);
i++;
}while(i<); int j=;
while(j<){
System.out.println("j="+j);
j++;
} for(int k=;k<;k++)
{
System.out.println("k="+k);
} int q=;
for(System.out.println("a");q<;System.out.println("c"))
{
System.out.println("d");
q++;
}
}
}

java练习---7的更多相关文章
- Spark案例分析
一.需求:计算网页访问量前三名 import org.apache.spark.rdd.RDD import org.apache.spark.{SparkConf, SparkContext} /* ...
- 故障重现(内存篇2),JAVA内存不足导致频繁回收和swap引起的性能问题
背景起因: 记起以前的另一次也是关于内存的调优分享下 有个系统平时运行非常稳定运行(没经历过大并发考验),然而在一次活动后,人数并发一上来后,系统开始卡. 我按经验开始调优,在每个关键步骤的加入如 ...
- Elasticsearch之java的基本操作一
摘要 接触ElasticSearch已经有一段了.在这期间,遇到很多问题,但在最后自己的不断探索下解决了这些问题.看到网上或多或少的都有一些介绍ElasticSearch相关知识的文档,但个人觉得 ...
- 论:开发者信仰之“天下IT是一家“(Java .NET篇)
比尔盖茨公认的IT界领军人物,打造了辉煌一时的PC时代. 2008年,史蒂夫鲍尔默接替了盖茨的工作,成为微软公司的总裁. 2013年他与微软做了最后的道别. 2013年以后,我才真正看到了微软的变化. ...
- 故障重现, JAVA进程内存不够时突然挂掉模拟
背景,服务器上的一个JAVA服务进程突然挂掉,查看产生了崩溃日志,如下: # Set larger code cache with -XX:ReservedCodeCacheSize= # This ...
- 死磕内存篇 --- JAVA进程和linux内存间的大小关系
运行个JAVA 用sleep去hold住 package org.hjb.test; public class TestOnly { public static void main(String[] ...
- 【小程序分享篇 一 】开发了个JAVA小程序, 用于清除内存卡或者U盘里的垃圾文件非常有用
有一种场景, 手机内存卡空间被用光了,但又不知道哪个文件占用了太大,一个个文件夹去找又太麻烦,所以我开发了个小程序把手机所有文件(包括路径下所有层次子文件夹下的文件)进行一个排序,这样你就可以找出哪个 ...
- Java多线程基础学习(二)
9. 线程安全/共享变量——同步 当多个线程用到同一个变量时,在修改值时存在同时修改的可能性,而此时该变量只能被赋值一次.这就会导致出现“线程安全”问题,这个被多个线程共用的变量称之为“共享变量”. ...
- Java多线程基础学习(一)
1. 创建线程 1.1 通过构造函数:public Thread(Runnable target, String name){} 或:public Thread(Runnable target ...
- c#与java的区别
经常有人问这种问题,用了些时间java之后,发现这俩玩意除了一小部分壳子长的还有能稍微凑合上,基本上没什么相似之处,可以说也就是马甲层面上的相似吧,还是比较短的马甲... 一般C#多用于业务系统的开发 ...
随机推荐
- 一个基于jQuery写的弹窗效果(附源码)
最近项目中频繁遇到需要弹出窗口的功能,一直使用浏览器默认的Alert和Confirm弹窗,感觉视觉效果不是那么好,而从网上下载的话又找不到合适的,找到的话有些也是十分臃肿,有时候感觉学习配置的功夫自己 ...
- Zabbix监控ActiveMQ
当我们在线上使用了ActiveMQ 后,我们需要对一些参数进行监控,比如 消息是否有阻塞,哪个消息队列阻塞了,总的消息数是多少等等.下面我们就通过 Zabbix 结合 Python 脚本来实现对 Ac ...
- java关键字-abstract
抽象:不具体,看不明白. 抽象类表象体现. 在不断抽取过程中,将共性内容中的方法声明抽取,但是方法不一样,没有抽取,这时抽取到的方法,并不具体,需要被指定关键字abstract所标示,声明为抽象方法. ...
- JS工具整理
1.获取今日日期:摘抄地址:https://www.cnblogs.com/carekee/articles/1678041.html getTodayFmt('yyyy-MM-dd') getTod ...
- java写出PDF
1\包 <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</ar ...
- ES集群监控 之 Cerebro 0.8.3 安装及简单使用
注意权限,不建议使用root,同es集群的启动用户相同即可 1. 下载 & 解压 # 下载 wget https://github.com/lmenezes/cerebro/releases/ ...
- Codeforces 777C:Alyona and Spreadsheet(思维)
http://codeforces.com/problemset/problem/777/C 题意:给一个矩阵,对于每一列定义一个子序列使得mp[i][j] >= mp[i-1][j],即如果满 ...
- 玩转SpringBoot之MyBatisplus自动化构建工具
使用MyBatisplus自动化构建项目 为什么要用这个? 方便 因为之前那种方式让我用起来不爽了:mybatis逆向工程(MyBatis Generator) 能紧密的贴合mybatis,并且MyB ...
- C++一些知识的整理
1. C 和 C++ 区别 C++支持多种编程范式:面向对象编程.泛型编程.过程化编程.支持类.封装.重载等特性. c和c++的头文件不同. 输入输出不同. 变量的声明定义不同:c语言:变量要放在语句 ...
- 广告过滤器 Adguard Pre v6.4.1814 Lite V2 简约绿色版
下载地址:点我 基本介绍 当你在浏览网页的时候总是弹出广告是不是非常的不爽,小编为伙伴们提供了Adguard Pre简约绿色版,一款专业的广告过滤器.Adguard Pre简约绿色版可以帮助伙伴们完美 ...