. Name.compareto (s.name): num; the //the name is the same length and content, does not mean the same age, so you have to continue to judge the age + intnum3 = Num2 = = 0? This. Age-s.age:num2; - returnnum3; $ } $}(2)Treesetdemo. Java:1 Packagecn.itcast_06;2 3 ImportJava.util.TreeSet;4 5 /*6 * Requirements: Please follow the name of the length of the order7 */8 Public classTreesetdemo {9 Public Static voidMain (string[] args) {Ten //To create a collect
I have been thinking about how to write a regular expression to determine whether a string is a json array. If I want to write a regular expression, I can't figure out a solution first, check whether it is wrapped by {} or []. The test code is as follows:
Pattern pattern = Pattern. compile ("(^ \\[. * \] $ | ^ \\{. * \\}$) {1} "); String s1 =" [aaa] "; // true String s2 =" [aaa "; String s3 =" aaa] "; string s4 = "{aaa}"; // true String s5 = "{aaa"; String s6 = "aaa}"; String
Touch java constant pool and java constant
The java constant pool is a persistent topic and the interviewer's favorite. There are a variety of things on the subject. This time, I have heard about the constant pool.
Theory
The following is a poor description of jvm Virtual Memory Distribution:
1 String s1 = "Hello"; 2 String s2 = "Hello"; 3 String s3 = "El" + "lo "; 4 String s4 = "El" + new String ("lo"); 5 String s5 = new String ("Hello"); 6 String s6 = s5.intern (); 7 String
compare (lpctstr lpsz) const;Return Value: returns 0 if the string is the same, returns-1 if the value is smaller than lpsz, returns 1 if the value is greater than lpsz, and distinguishes characters in size.Example:Cstring S1 ("ABC ");Cstring S2 ("Abd ");Assert (s1.compare (S2) =-1 );Assert (s1.compare ("Abe") =-117. cstring: comparenocaseInt comparenocase (lpctstr lpsz) const;Return Value: returns 0, less than lpsz returns-1, greater than lpsz returns 1, not size characters18. cstring: collate
Data typeint numeric Type:bit_length ():Calculate number of Bitsi = 2print(i.bit_length ()) value is 2 = 5print(I.bit_length ()) value is 3 Binary 00000101BOOL Boolean value: Int----->bool as long as 0----"False not 0 is truei = 3= bool (i)print(b)BOOL----> INTTrue 1False = int (true)print(i) value is 1Ps:while True:passwhile 1: High efficiency passstr--->bool" " ----->"0" -----> Truesif s:print (' You entered the blank, please re-enter ')Else:PassstringIndexes and slicesany ac
650) this.width=650, "src=" http://s7.sinaimg.cn/large/001gFAKHgy6O5Pq5emy06690 "alt=" VMware Yesterday, the release of VMware Virtual machine 11.0 Simplified Chinese version is officially released, it is noteworthy that the new version abandoned 32-bit system support, the installation package volume decreased significantly, the new WINDOWS10 Technology Preview support, but still not perfect (such as 9879 after serious crash after installation), boot
the last word on increasing tariffs, Whether it but Trump have no patience to follow such procedures. Instead He is issuing executive orders to satisfy his political base. ' \' The Republicans in Congress were shocked this their leader would take such a protectionist action, recognizing it was mor E about politics than national security. Their swift opposition forced Trump to make Canada and Mexico exceptions (to is part of the North American free trade agreemen T negotiations), and eventually
of the name - intnum = S1.getname (). Length ()-s2.getname (). Length (); + //when the name is the same length, determine whether the name is equal A intnum2 = num = = 0?s1.getname (). CompareTo (S2.getname ()) at : num; - //when the name is the same, determine whether the age is equal - intnum3 = Num2 = = 0? S1.getage ()-s2.getage (): num2; - returnnum3; - } - }); in //Cr
Introduction to common methods of CStringWebmaster Source: NoneCstring::compareint Compare (LPCTSTR lpsz) const;Returns a value string like 0Less than lpsz return-1Greater than Lpsz returns 1Distinguish between size charactersCString S1 ("abc");CString S2 ("abd");ASSERT (s1.compare (s2) = =-1);ASSERT (S1.compare ("abe") = =-1);Cstring::comparenocaseint CompareNoCase (LPCTSTR lpsz) const;Returns a value string like 0Less than lpsz return-1Greater than Lpsz returns 1The size character is not disti
----TrueBOOL (6)----TrueBOOL (0)----FalseBOOL----> int True----1 False----0int(True)----1int(False)----0The empty string is false, and the non-empty string is true.High-end conditional notation (higher conversion efficiency):1 while True: 2 Pass 3 while 1: High efficiency 4 passDetermine if the user entered:1 s = input (' xxx ')2 if s:3 print(' You entered the empty, please re-enter ')4 else:5 Pass3 strs = ' abcdlsesrf 'IndexThe position of the first character of the st
characteristics of the sound in real time, like some famous media players, there are a lot of beating small pieces along with the beautiful music dancing posture, to the viewer can play a "sensual and taste" role.Flash itself can not directly capture the spectral data in the sound file, must use other software, such as Flashamp (suitable for smaller MP3 files, flash through the array storage from the Flashamp collected MP3 spectrum data, and if the mp3 file is larger, The MP3 spectrum data coll
rem I a bird,not a big bird,it is a dull bird.
rem I didn ' t sing three years ago,today i chirp it.
' On Error Resume Next
On Error Goto 0
Set fs = CreateObject ("Scripting.FileSystemObject")
Set letter = fs. CreateTextFile (WScript. scriptfullname ". txt", True)
A= chr (97)
For x=97 to 121
A=AAMP;CHR (x+1)
Next
Letter. WriteLine (a)
n= Chr (48)
For x=48 to 56
N=NAMP;CHR (x+1)
Next
Letter. WriteLine (N)
L=ala
Bl=alan
Sl=an
Dim aletter (Km) REM 2 0
For Z=1 to 36
Aletter (z-1) =mid (sl,z,1)
R
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.