expression.Parameter regex is a regular-expression matching pattern instead of a simple string, and he may have unexpected results for some special characters, such as testing the following code with a vertical bar | Delimited string, you will not get the expected resultFor example the situation A:AAA|BBB|CCC string[] aa = "AAA|BBB|CCC". Split ("\\|" ); This will get the correct result for (int i = 0; I ) { System.out.println ("--" +
7>aa[i]);
such as B:AAA*BBB*CCC
Abstractmethod();//Abstract method Public Static Abstract classinnerclass{//Abstract inner class, forced public static by default //......}enumMyenum{red,blue,grren}//enum class, forcing public static by default Interfaceinnerinteerface{//nested interface, default force public static void AA(); }}classMyClassImplementsinterfacetest{//Implement the above interface @Override Public int Abstractmethod() {//Imple
This problem was recently encountered in optimizing the code: What is the efficiency of the iterator and the enhanced for loop? Before learning, it seems to remember that the teacher said to traverse the collection (such as list), the use of iterator seems normal, because it is dedicated, but the efficiency of the operation is not really considered, today did an experiment: a simple comparison of the two, concluded that: Enhanced for loop runs more efficiently. But I am not sure whether this
Java-JFrame-swing nested browser steps,
Java-JFrame-swing nested browser steps
1. functions to be implemented using swing nested browsers:
By embedding a browser in a form using java swing, you can display the content of another p
Nested exception is java. io. FileNotFoundException: class path resource [spring/spring-datasource-mog, nestedexception
Problems found during spring unit testing:
Org. springframework. beans. factory. beanDefinitionStoreException: IOException parsing XML document from class path resource [spring/spring-datasource-mogon.xml]; nested exception is
Nested classes and internal classes are used extensively in Java, and to avoid being difficult to understand, here are a few small examples of how to use them.
The structure of nested classes and inner classes such asStatic Nested ClassesA static nested class, which is
function: Add (add) or subtract (sub) A time interval value (expr) for a given time date, respectivelyFormat: (1) interval is the key word for time interval(2) expr is an expression that corresponds to the following type(3) unit is the interval of units (interval type) (20), as follows: Example 1: (the current time plus one day) Example 2: (Minus one minute a day) 4. Personalized Display Date: (1) DayOfWeek (date); --The day of the week (2) Day
Get started with java-8.9 Nested classes (using static internal classes)
In this section, we will discuss Nested classes.
1. Concept
When internal classes use static, they are nested classes.
package com.ray.ch07;public class Test {private static class MyTest3{}}
MyTest3 is a nest
1. How to jump out of the current multi-nested loop in java? In java, if you want to jump out of multiple nested loops, you can define a label before the loop statement, and then use the break statement with the label in the code in the loop body to jump out of the outer loo
In this chapter we discuss nested classes.1. ConceptInner classes are nested classes when static is used.Package Com.ray.ch07;public class Test {private static Class mytest3{}}MYTEST3 is a nested class2. Attention points(1) can only communicate with the static part of the outer class(2) Do not hold references to external class objects, you can use the static prop
);//output The value of an array element individually the } + } - } the Bayi /** the * foreach output three-dimensional array the */ - Public voidtestArray3 () { - intArr[][][] = { the{{1, 2}, {3, 4}}, the{{5, 6}, {7, 8}} the }; the -SYSTEM.OUT.PRINTLN ("----4----foreach output three-dimensional array test"); the for(int[] a2:arr) { the for(
The native framework of android uses a lot of c ++ Nested classes, while the java framework uses a lot of internal Nested classes. I have read some books and code to make a summary.1. The non-static internal class of java has an external class reference outer. This variable can be used to reference all external variabl
static, it is equivalent to an outer class, no longer an inner class5. Internal classes can be defined not only within a class, but also within the scope of several program blocks. For example, in a method, even inside a for loop body can be nestedThe inner class defined in the method can only access local variables of the final type in the method, because the scope of the local variable is only within this method, and when the external program is called, the local variable memory is retracted,
defining a method, you do not know that you can use a variable parameter when you define several parameters - * 2. Format: the * Modifier return value type method name (data type ... Variable name)Bayi * the * 3. Precautions: the * This mutable parameter is essentially an array - * If there are multiple parameters, the variable parameter must be placed in the last - */ the Public Static voidMain (string[] args) { the the
Based on the new features of JDK5, use a for loop map, such as the Key for loop map
123
for(String dataKey : paraMap.keySet()) {System.out.println(dataKey );}
Note how paramap is defined, if it is a simple map paramap = new HashMap (); The string in front can only be converted to object.The key and value of the entire map
123456789101112
Mapnew LinkedHashMapmap.put(1,"星期一");map.put(2,"星期二");map.put(3,"星
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.