//程序员:罗元昊 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的更多相关文章

  1. Spark案例分析

    一.需求:计算网页访问量前三名 import org.apache.spark.rdd.RDD import org.apache.spark.{SparkConf, SparkContext} /* ...

  2. 故障重现(内存篇2),JAVA内存不足导致频繁回收和swap引起的性能问题

    背景起因: 记起以前的另一次也是关于内存的调优分享下   有个系统平时运行非常稳定运行(没经历过大并发考验),然而在一次活动后,人数并发一上来后,系统开始卡. 我按经验开始调优,在每个关键步骤的加入如 ...

  3. Elasticsearch之java的基本操作一

    摘要   接触ElasticSearch已经有一段了.在这期间,遇到很多问题,但在最后自己的不断探索下解决了这些问题.看到网上或多或少的都有一些介绍ElasticSearch相关知识的文档,但个人觉得 ...

  4. 论:开发者信仰之“天下IT是一家“(Java .NET篇)

    比尔盖茨公认的IT界领军人物,打造了辉煌一时的PC时代. 2008年,史蒂夫鲍尔默接替了盖茨的工作,成为微软公司的总裁. 2013年他与微软做了最后的道别. 2013年以后,我才真正看到了微软的变化. ...

  5. 故障重现, JAVA进程内存不够时突然挂掉模拟

    背景,服务器上的一个JAVA服务进程突然挂掉,查看产生了崩溃日志,如下: # Set larger code cache with -XX:ReservedCodeCacheSize= # This ...

  6. 死磕内存篇 --- JAVA进程和linux内存间的大小关系

    运行个JAVA 用sleep去hold住 package org.hjb.test; public class TestOnly { public static void main(String[] ...

  7. 【小程序分享篇 一 】开发了个JAVA小程序, 用于清除内存卡或者U盘里的垃圾文件非常有用

    有一种场景, 手机内存卡空间被用光了,但又不知道哪个文件占用了太大,一个个文件夹去找又太麻烦,所以我开发了个小程序把手机所有文件(包括路径下所有层次子文件夹下的文件)进行一个排序,这样你就可以找出哪个 ...

  8. Java多线程基础学习(二)

    9. 线程安全/共享变量——同步 当多个线程用到同一个变量时,在修改值时存在同时修改的可能性,而此时该变量只能被赋值一次.这就会导致出现“线程安全”问题,这个被多个线程共用的变量称之为“共享变量”. ...

  9. Java多线程基础学习(一)

    1. 创建线程    1.1 通过构造函数:public Thread(Runnable target, String name){}  或:public Thread(Runnable target ...

  10. c#与java的区别

    经常有人问这种问题,用了些时间java之后,发现这俩玩意除了一小部分壳子长的还有能稍微凑合上,基本上没什么相似之处,可以说也就是马甲层面上的相似吧,还是比较短的马甲... 一般C#多用于业务系统的开发 ...

随机推荐

  1. C#最新功能(6.0、7.0)

    一直用C#开发程序,.NET的功能越来越多,变化也挺大的,从最初的封闭,到现在的开源,功能不断的增加,一直在进步.作为C#的强烈支持者,C#的变化,我不能不关注,这篇文章主要介绍,C#6.0和C#7. ...

  2. http-post调用接口简单代码

    一.简单便捷的httpget调用接口,并且返回接口数据1.导入相应的jar包: 2.代码如下: HttpPost post = null; try { HttpClient httpClient = ...

  3. 【MYSQL】mysql大数据量分页性能优化

    转载地址: http://www.cnblogs.com/lpfuture/p/5772055.html https://www.cnblogs.com/shiwenhu/p/5757250.html ...

  4. 【转】JDK 内存参数含义

    Eclipse崩溃,错误提示: MyEclipse has detected that less than 5% of the 64MB of Perm  Gen (Non-heap memory) ...

  5. 【Zookeeper02】ZK的作用以及使用

    上一篇介绍了ZK的安装以及集群的搭建,这只能算是个软件安装过程,具体是做什么的.怎么用也没有做解释,这一篇中博主就自己的私人理解简单写一下: 1.是什么: a.Zookeeper是一个分布式协调服务, ...

  6. linux下svn安装

    1.环境centos6.4 2.安装svnyum -y install subversion 3.配置 建立版本库目录mkdir /www/svndata svnserve -d -r /www/sv ...

  7. JavaScript 之有趣的函数(函数声明、调用、预解析、作用域)

    前言:“函数是对象,函数名是指针.”,函数名仅仅是指向函数的指针,与其他包含函数指针的变量没有什么区别,话句话说,一个函数可能有多个名字. -1.函数声明,function+函数名称.调用方法:函数名 ...

  8. 精通并发与 Netty (二)常用的 rpc 框架

    Google Protobuf 使用方式分析 对于 RPC 协议来说,最重要的就是对象的发送与接收,这就要用到序列化与反序列化,也称为编码和解码,序列化与反序列化和网络传输一般都在对应的 RPC 框架 ...

  9. RedisDesktopManager远程连接Linux系统的Redis服务

    linux下安装redis :https://www.runoob.com/redis/redis-install.html 进入 src 运行redis   : ./redis-server 打开另 ...

  10. ZigBee入门第一天

    按键查询控制灯的状态 1.宏定义灯和按键 2.按键和灯初始化 3.用if语句消抖的方法,实现按键控制灯的状态 相关寄存器 PxSEL PxDIR #include"ioCC2530.h&qu ...