Java 2017.9.25 Yang Haoning Jobs

Source: Internet
Author: User

ImportJava.util.Scanner; Public classTest { Public Static voidMain (string[] args) {System.out.println ("5+5=" + 5 + 5); intA = 3, B; b= a++; System.out.println ("A=" + A + ", b=" +b); intA1 = 3, B1; B1= ++A1; System.out.println ("A=" + A + ", b=" +b);  Shorts = 3; S= ( Short) (S + ( Short) 4); System.out.println ("S=" +s); System.out.println (6 & 3); System.out.println (6 | 3); System.out.println (6 ^ 3); System.out.println (3 << 2); System.out.println (3 >> 1); intx = 0, y; Y= x > 1? 100:200; System.out.println ("Y=" +y); Scanner hy=NewScanner (system.in); inth,h1; System.out.println ("Please enter two integers in turn"); H=NewInteger (Hy.nextline ()); //int aaa = Hy.nextint ();System.out.println ("Please enter a second integer"); H1=NewInteger (Hy.nextline ()); inttemp = h > h1?h:h1;                SYSTEM.OUT.PRINTLN (temp); System.out.println ("Please enter three integers in turn"); intK,K1,K2,TEMP1,TEMP2; K=NewInteger (Hy.nextline ()); K1=NewInteger (Hy.nextline ()); K2=NewInteger (Hy.nextline ()); Temp1= k > K1?K:k1; Temp2= Temp1 > K2?Temp1:k2;                        System.out.println (TEMP2); System.out.println ("Input number 1-12"); intmonth; Month=NewInteger (Hy.nextline ()); if(Month >= 3 && month <= 5) {System.out.println (Spring); }Else if(Month >= 6 && month <= 8) {System.out.println (Summer); }Else if(Month >= 9 && month <= 11) {System.out.println (Autumn); }Else if(Month >= && month <= 2) {System.out.println (Winter); }Else{System.out.println ("wrong input! ");} System.out.println ("Input number 1-12"); intmonth1; Month1=NewInteger (Hy.nextline ()); Switch(month1) { Case' 3 ': Case' 4 ': Case' 5 ': System.out.println (Spring);  Break;  Case' 6 ': Case' 7 ': Case' 8 ': System.out.println (Summer);  Break;  Case' 9 ': Case' 10 ': Case' 11 ': System.out.println (Autumn);  Break;  Case' 12 ': Case' 1 ': Case' 2 ': System.out.println (Winter);  Break; default: System.out.println ("Wrong input!" ");  Break; }                intv = 1;  Do{System.out.println ("V=" +v); V++; } while(V < 1); intm = 1;  while(M < 1) {System.out.println ("M=" +m); M++; }                intg = 1;  for(System.out.println ("a"); G < 3; System.out.println ("C")) System.out.println ("D")) G++;    System.out.println (g); }}

Java 2017.9.25 Yang Haoning Jobs

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.