java +

1public class Sample { 2 3 public static void main(String[] args) {int a, b, c, d, e; 4 Scanner s = new Scanner(System.in); 5 System.out.print("Enter any integer a:"); 6 a = s.nextInt(); 7 b = ++a; 8 System.out.println("Result after Pre Increment a:"+a); 9 System.out.println("Result after Pre Increment b:"+b); 10 c = a++; 11 System.out.println("Result after Pre Increment a:"+a); 12 System.out.println("Result after Post Increment c:"+c); 13 d = --a; 14 System.out.println("Result after Pre Increment a:"+a); 15 System.out.println("Result after Pre Decrement d:"+d); 16 e = a--; 17 System.out.println("Result after Pre Increment a:"+a); 18 System.out.println("Result after Post Decrement e:"+e); 19 } 20} 21 22 23 24OUTPUT: 25Enter any integer a:12 26Result after Pre Increment a:13 27Result after Pre Increment b:13 28Result after Pre Increment a:14 29Result after Post Increment c:13 30Result after Pre Increment a:13 31Result after Pre Decrement d:13 32Result after Pre Increment a:12 33Result after Post Decrement e:13
点赞
收藏

评论区

加载中...

相关推荐

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

vue element table 表头添加图标

!(https://oscimg.oschina.net/oscnet/189d567e07e0844612470867b06a35c0aaf.jpg)!(https://oscimg.oschina.net/oscnet/dc3b454d663d8618924b78796345a145b3f.jpg)1<template

java 多行注释

publicclassSample{publicstaticvoidmain(Stringargs){//javacompilerignoresthecommentSystem.out.println("Javaprogrammer");

MySQL 的慢 SQL 怎么优化?

!(https://oscimg.oschina.net/oscnet/7b00ec583b5e42cc80e8c56c6556c082.jpg)Java技术栈www.javastack.cn关注阅读更多优质文章(https://www.oschina.net/action/GoToLink?urlhttp

Android So动态加载 优雅实现与原理分析

背景:漫品Android客户端集成适配转换功能(基于目标识别(So库35M)和人脸识别库(5M)),导致apk体积50M左右,为优化客户端体验,决定实现So文件动态加载.!(https://oscimg.oschina.net/oscnet/00d1ff90e4b34869664fef59e3ec3fdd20b.png)点击上方“蓝字”关注我