//程序员:罗元昊 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. Spring之基于注解的注入

    对于DI使用注解,将不再需要在Spring配置文件中声明Bean实例.Spring中使用注解,需要在原有Spring运行环境基础上再做一些改变,完成以下三个步骤. (1)导入AOP的Jar包.因为注解 ...

  2. 我与微软的不解之缘 - 我的Insider Dev Tour 2019讲师之旅

    标题:我与微软的不解之缘 - 我的Insider Dev Tour 2019讲师之旅 作者:Lamond Lu 大家好,我是陆楠,来自北京盛安德青岛分公司,今年非常有幸作为讲师参加了微软Insider ...

  3. 编译php扩展

    在php编译安装好的情况下php扩展编译 php的很多模块都是以php的扩展形式来进行的.所以在php安装好的环境下需要用到之前安装时没有编译安装的php扩展的时候,这个时候编译安装php扩展就显得尤 ...

  4. PATB 1018. 锤子剪刀布

    时间限制 100 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 大家应该都会玩“锤子剪刀布”的游戏:两人同时给出手势,胜负规则如图 ...

  5. Linux服务器使用Docker部署.net Core项目

    发布ASP.NET Core项目 和普通的项目发布一样,将项目发布到目标文件夹中 构建Dockerfile文件 在目标文件根目录新建Dockerfile文件(没有后缀) FROM microsoft/ ...

  6. JavaScript面向对象之对象的声明、遍历和存储

    一.对象的声明方式 1. 字面式(json格式)声明对象 var obj={ 属性名:属性值, 方法名:function(){ //函数执行体 } } 2. new 操作符+Object 声明对象 v ...

  7. 常用的方法论-5why

  8. MyBatis从入门到精通(九):MyBatis高级结果映射之一对一映射

    最近在读刘增辉老师所著的<MyBatis从入门到精通>一书,很有收获,于是将自己学习的过程以博客形式输出,如有错误,欢迎指正,如帮助到你,不胜荣幸! 本篇博客主要讲解MyBatis中实现查 ...

  9. 十分钟教你理解TypeScript中的泛型

    转载请注明出处:葡萄城官网,葡萄城为开发者提供专业的开发工具.解决方案和服务,赋能开发者.原文出处:https://blog.bitsrc.io/understanding-generics-in-t ...

  10. scrapy基础知识之 CrawlSpiders(爬取腾讯校内招聘):

    import scrapyfrom scrapy.spider import CrawlSpider,Rulefrom scrapy.linkextractors import LinkExtract ...