dynamically invoking objects using reflection, such as a Addsaray method in the employee class, we look at how to invoke:Class C3 = Class.forName ("Employee"), Object E3 = C3.newinstance (); Field Fsaray = C3.getdeclaredfield ("Saray"); Fsaray.setaccessible (true); Fsaray.set (E3, 10000); System.out.println (Fsaray.get (E3)); Output 10000//get Methodmethod m = C3.getdeclaredmethod ("Addsaray", double.class);/* * Method m = C3.getdeclaredmethod (" Addsaray "); Method m2 = * C3.getdeclaredmethod
-h option for top is clearly stated: All thread information below this process will be printed. That is, a program that launches multiple threads, the next thread in Linux will correspond to a process!At this point, we can use Jstack to further analyze the thread's dump file:650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7E/D5/wKioL1cKJhiDetsKAACWujw9FVA711.png "title=" Sogou _ 2016-04-10_17-59-49.png "alt=" Wkiol1ckjhidetskaacwujw9fva711.png "/>We can easily get the names of these t
)
Instantiation (in the case of an inner class, pay particular attention to the instantiation method, which can be referenced by using new and reflection to produce an instantiated object of the Java inner Class)
Sign in to map
Static{Reflections Reflections =NewReflections ("Prepare");//Package name, can reduce the search scopeset for(classintIDX = Typename.lastindexof ("$");//inner class scene intIDX1 = Typename.lastindex
) { System.out.println ("---" +invokername+ "----" +adb); } }
The output is:---452345234----q31234132
Articles you may be interested in:
Analysis of private attribute inheritance problem in PHP class
Query for private access control in PHP classes and objects
public,private,protected Differences in PHP class and example analysis
An analysis of PHP object-oriented public private protected access modifier
is the private modifier in Java
Address: http://blog.csdn.net/kongxx/article/details/7259827
One of Java Socket practices: Single-thread Communication
Java Socket practice 2 multi-thread Communication
Previous two articlesArticleThis article describes how to establish Java Socket communication, and describes how to use
Java Drp project practice-Servlet, drpservletOrigin
Before explaining the Servlet, we need to first introduce a word CGI, that is, the Common GatewayInterface is the meaning of a universal gateway interface, which provides an interface for a computer program with the HTTP protocol or WWW Service, that is, the meaning of the human-computer interaction interface. When a Web application runs on a server and a
The Java language may be the most widely used programming language that relies on garbage collection, but it is not the first. Garbage collection has become an integral part of many programming languages, including Lisp, Smalltalk, Eiffel, Haskell, ML, scheme, and Modula-3, and has been in use since the early the 1960s. In this article in Java theory and Practice
is used when checking user permissions. In short, this part of the content is a bit difficult, you need to be able to write a comprehensive vim command, while the relevant process of Hadoop know.SummarizeNow the Python command, I think, theory and practice is really very different, continuous learning process, not only to overcome the inherent flaws in the code, but also to the kernel principle has a deeper understanding. Fortunately, the good habits
Java Drp project practice-Environment Building
Summary
To start a Java project development, we need to build a Java Development Environment. What do we need to build a Java Development Environment, what are the precautions.
Process
First, let me list the software I us
In the current java World, many things are called x×let, and x×let all mean small programs. For example, applet applications, servlet server-side applets, mini programs in the midlet mobile phone, and small programs in the portlet portal container. In this section, we will introduce the applet. This is not a lot of things, but it makes sense in the java architecture. This item can be run in a browser and ca
Mathematics 5 Zhao Society]Table [key=c005, Rest= World Modern History 2 Chen]Table [key=c006, Rest=java programming 8 Lin]-----------------------------------------Enter the number to select the function:1: Find the course according to the course number;2: Delete the course according to the course number:3: Add a course record to the curriculum:4: Show all course records in curriculum5: Revise curriculum record in curriculum-1: Exit------------------
,jni_version_1_4)!=JNI_OK){return-1;}Jclass jthiz = Env->findclass (ClassPath);if (Env->registernatives (Jthiz,methods,sizeof (methods)/sizeof (Methods[0])) {return-1;}return jni_version_1_4;}As can be seen from the above code, the JNI layer through the Pthread library to complete the creation of threads, it is important to note that the JNI layer of the thread, must be through the global JAVAVM to get to the environment variables, but also through the global jobject to get the
First, the use of Java practice algorithms often need to use the console's data input and output, the following record the basic use of the method:Basic usage1 ImportJava.util.*;2 Public classMain {3 Public Static voidMain (string[] args) {4Scanner cin =NewScanner (system.in);//Common scanner classes to get data5 intA = Cin.nextint ();//converts the input data to an int type assigned to a, the
cases provides better performance and scalability than locks. If you strictly follow the use of volatile conditions-that is, the variable is really independent of the other variables and its own previous values-in some cases you can use the volatile substitution synchronized to simplify the code. However, volatile the code used is often more error-prone than code that uses locks. The pattern described in this article covers some of the most common use cases that can be used volatile instead syn
application of this pattern is exceeded, it will become very difficult to combine these two competing synchronization mechanisms.
Conclusion
Compared with the lock, the volatile variable is a very simple but fragile synchronization mechanism that will provide better performance and scalability than the lock in some cases. If you strictly follow the volatile usage conditions-that is, variables are truly independent from other variables and their previous values-in some cases, you can usevolatile
Address: http://blog.csdn.net/kongxx/article/details/7259837
One of Java Socket practices: Single-thread Communication
Java Socket practice 2 multi-thread Communication
Java Socket 3 transmission object
Java Socket practice
Java Theory and Practice: Concurrent collection Classes
util.concurrent In addition to many other useful concurrent building blocks, the Douglea package contains some of the major collection types
List and
Map high-performance, thread-safe implementations. In this month's
Java theory and Practice ,
Java Drp project practice-ServletOrigin
Before explaining the Servlet, we need to first introduce a word CGI, that is, the Common GatewayInterface is the meaning of a universal gateway interface, which provides an interface for a computer program with the HTTP protocol or WWW Service, that is, the meaning of the human-computer interaction interface. When a Web application runs on a server and a client req
conversion of binary and decimal.NThe binary can be understood as: numericalxThe power of a base, such as the decimal number we are familiar with123.4=1x10²+2x10+3x (Tenof the0Second Power) +4x (Tenof the-1Second Power)the same is true of other binaries, such as binary numbers11.01=1x2+1x (2of the0Second Power) +0+1x (2of the-2Second Power)=of decimal3.The child's powder forging, the crazy fist -. Doublethe value of the type occupies64bit, i.e. -Binary number, except that the highest bit repres
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.