Long 070000L front 0 minus compare size, Token,mysql innodb,properties,switch match empty string object

Source: Internet
Author: User
Tags define get uuid

 Public classTestjava {//define get resource file    Private Static FinalResourceBundle bundle =Initbundle (); Private StaticResourceBundle Initbundle () {returnResourcebundle.getbundle ("Conf/chinapay", Locale.china); }    //Key-value pairs    Private Final StaticString merid_upop_test = bundle.getstring ("Merid.upop.test"); /**     * @paramargs*/     Public Static voidMain (string[] args) {//Long reqtime = 20150227233132L; //Long reqtimeallowmin = 070000L;//Long Reqtimeallowmax = 220000L;//Long Reqtime =NULL; if(Reqtime! =NULL&& (reqtime% 1000000 >= reqtimeallowmin && reqtime% 1000000 <=Reqtimeallowmax)) {System.out.println ("OK"); }Else{System.out.println ("NO");//NO        }//try {System.out.println (20150227103132L% 1000000);//103132System.out.println (20150227143453L% 1000000);//143453System.out.println (20150227171104L% 1000000);//171104System.out.println (20150302153222L% 1000000);//153222//CommonConstants.TIME_SEC_STR.format ("070000"); //Date dd = CommonConstants.DATETIME_SEC_STR.parse (reqtime.tostring ());//CommonConstants.TIME_SEC_STR.format (obj)//} catch (ParseException e) {//            //TODO auto-generated Catch block//e.printstacktrace ();//        }  //Convert into Date//1. Generate token Value MethodSystem.out.println ("token=" + Java.util.UUID.randomUUID (). toString ());//token=572061ad-522f-4cc4-8484-aab5f9e44120System.out.println ("token2=" + Java.util.UUID.randomUUID (). toString (). Replace ("-", ""));//Token2=f858b55617c6421bbbc90a66747c62ea//2.Long value Comparison size            /**Allow automatic voice and 15 minute auto-reject point in time of order start*/Long reqtime_allow_min= 070000L;//7 Front This 0 needs to be removed.             /**allow auto-voice and 15-minute auto-reject point-in-time at end of order*/Long Reqtime_allow_max= 220000L;//            //Long currtime = long.valueof (CommonConstants.DATETIME_SEC_STR.format (New Date ()));Long Currtime = 20150319050809L; System.out.println ("Currtime=" +currtime);//currtime=20150319050809System.out.println ("Get seconds minutes =" +currtime% 1000000);//get time division seconds =50809System.out.println ("is greater than 7 points =" + (currtime% 1000000 >= reqtime_allow_min));//is greater than 7 points =true, this comparison value is wrong!!??System.out.println ("is less than 22 points =" + (currtime% 1000000 <= reqtime_allow_max));//is less than 22 points =true                        /** dial Voice function point: 1. When the deposit is successful, voice notification. (the owner agrees or rejects the order) * 2. Launch the delay request successfully, voice notification. (The owner agrees or refuses to delay the application) * 3.2 hours before the car, without paying the rental deposit or security deposit, voice notification. (The tenant pays the car rental deposit and the violation deposit) * 4.2 hours before the vehicle, voice notification. (Renter's car)*/            //050809 should not call at this time. 05:08:09            if(Currtime! =NULL&& (currtime% 1000000 >= reqtime_allow_min && currtime% 1000000 <=Reqtime_allow_max)) {System.out.println ("Call Voice phone notifications!");//Call voice call notifications!}Else{System.out.println ("Night 10 o'clock to the next morning 7-point anti-disturb function, voice phone screen. "); }            //Long atest = 050809L;//Long reqtime_allow_min = 070000L; //the back 4 bits are all 0 can//System.out.println ("@@@" + (050809l > 70000l)); //compile pass but.??!!System.out.println ("@@@" + (50809l > 70000l));//@@ ZZFCTHOTFIXZSystem.out.println ("@@@" + (50809l > 070000l));//@@ ZZFCTHOTFIXZ Error !                                    /*** 3.MYSQL Transaction * INNODB,MYISAM * mysql5.6 Transaction supports operation of InnoDB table types for multiple tables, and does not allow simultaneous operation of InnoDB and MyIsam tables. */                        //4. Get the Proerties file, note: The properties file is not allowed to have a space comma, and so on. //merid.upop.test=808080031312345SYSTEM.OUT.PRINTLN ("Print Output properties file key value:" +merid_upop_test); //Print Output Properties file key value: 808080031394973//5. Determine the condition and switch match string string. System.out.println ("5. Judging condition and switch matching string string"); String Rentreason=NULL;//Judging the reason for renting a car, this condition returns 1111111111//if (Rentreason! = null) {//If this condition is not judged, a null pointer exception is reported.                 Switch(Rentreason) {//java.lang.NullPointerException                 Case"The surrounding tourism": System.out.println ("11111");  Break;  Case"Field Trip": System.out.println ("22222");  Break; default: System.out.println ("33333");//33333                     Break; }//}else{//System.out.println ("33333");//            }                                    //The following wording is correct. String RentReason2 = "surrounding tourism";//determine the reason for renting a car "" Null            if("Travel Around". Equals (RentReason2)) {System.out.println ("Aaaaaa");//aaaaaa}Else if("Field Trip". Equals (RentReason2)) {System.out.println ("BBBBBB"); }Else{System.out.println ("CCCCCC"); } String RS=NULL;//System.out.println (Rs.equals ("surrounding tourism")); //null object tune equals will error//java.lang.NullPointerExceptionSystem.out.println ("Travel Around". Equals (RS));//this will not error, return false. False                            }}

Long 070000L front 0 minus compare size, Token,mysql innodb,properties,switch match empty string object

Related Article

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.