Constants, variables, data types wrong n+1 times.

Source: Internet
Author: User

 Public classHello {/** * * * * * * @param args*/     Public Static voidMain (string[] args) {String _$dd123="";//Defining Variables                inti; I=123;//semicolon to note is the English semicolon                        intm=1, n=2, x=4, y=5;//It's best to write separatelyFinalDoublePAI =3.14;//constants are assigned once, cannot be changed, and constant names are generally all uppercase//pai = 3.1415926;i=ddd; This will be an error, constants cannot be changedString strUserName="Tom lives in this room ."; System. out. println (strUserName); strUserName="Zhang San lives in this room ."; System. out. println (strUserName); byteb =127;//Range-128 to 127                 Shorts =2; intj =123; LongL =1234L;//The trailing flag L is determined to be a long type                intc = (int)1234l;//cast, show conversion                LongLL =b; floatf =123.45f;//you need to mark the end of the number with an "F"                DoubleD =12345; F= (float) D;//cast, must be of the relevant data type to be convertedF=l; Charv ='a';//single quote "' cause your single character to                intA =v; System. out. println ("A ="+a); Charg =98; System. out. println ("g ="+g); Boolean T=true;//logic True, both true and false are lowercaseT=false;//Logical False//TODO Auto-generated method stubs

Constants, variables, data types wrong n+1 times.

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.