The premise needs to know how to create new Java files and how to compile in Linux, otherwise please learn other knowledge first!!Import java.io.*;public class test{public static void Main (string[] args) throws exception{try{Process process=runtime.getruntime (). EXEC ("ls./");InputStreamReader reader = new InputStreamReader (Process.getinputstream ());LineNumberReader line = new LineNumberReader (
ObjectiveReusing code is one of the many compelling features of Java . But to be a very revolutionary language, it's not enough to just copy and change the code, and it has to be able to do more.The above methods are often used in the process-type language of C , but the results are not very good. As with everything in Java
;Import java.net.HttpURLConnection;Import Java.net.URL;public class Webpagesource {public static void Main (String args[]) {URL url;int responsecode;HttpURLConnection URLConnection;BufferedReader reader;String Line;try{generate a URL object, to get the source code of the Web page address is:http://www.sina.com.cnUrl=new URL ("http://www.sina.com.cn");Open URLURLConnection = (httpurlconnection) url.openconne
fruit.properties resource file,
Content is:
Apple=reflect.appleOrange=reflect.orange
Then write the main class code:
package reflect;
Import java.io.*;
Import java.util.*;
Interface fruit{public abstract void Eat ();}
Class Apple implements fruit{public void Eat () {System.out.println ("Apple");
Class Orange implements fruit{public void Eat () {System.out.println ("Orange"); }//Operations Properties File class class init{public static
Objective:KMP algorithm is a kind of string matching algorithm, which is discovered by Knuth,morris and Pratt simultaneously (called KMP algorithm). The key of KMP algorithm is to reduce the number of matches between the pattern string and the main string so as to achieve fast matching by using the information after the match failure. The popular practice is to implement a next () function, which itself contains local matching information for the pattern string. Because the next function is not
Java-1.4 code reuse
In this section, we will discuss how to reuse code.
1. Why?
I am not going to elaborate on this. I can give you a few reasons for this.
I have summarized the following:
For the boss: reduce costs, shorten development time, and maximize profits
For teamleader: accelerate the progress, compress the construction period, and deliver the most proje
What locks are in Java
This problem after I read
There are two main types of locks in Java: Internal lock synchronized and display lock Java.util.concurrent.locks.Lock. But the thought of this seemingly summed up is not quite right. Should be a series of locks implemented by the Java built-in lock and concurrent.
Why this says, because everything in
Recently, I recalled some of the little exercises that I have practiced in Java. Feeling is quite interesting, in retrospect, think of a lot of learning experience and bumpy, a small exercise to study half a day, treasure the past, face the future. The following contribution code, Java console input digital output multiplication table (
Java generated two-dimensional code
Related to some of the main class library, convenient for everyone to download:
Code Lib:Qrcode_swetake.jar (Website introduction--http://www.swetake.com/qr/index-e.html)
Decoding Lib:qrcode.jar (Website introduction--http://sourceforge.jp/projects/qrcode/)
"One",
The code is as followsImport Java.io.bufferedreader;import Java.io.inputstreamreader;import Java.net.httpurlconnection;import Java.net.url;public class Main {private String u; Private String encoding; public static void Main (string[] args) throws Exception {main client = new Main ("http://www.baidu.com/", "UTF-8"); Client.run (); } public Main (String u, string encoding) {this.u = u; this.encoding = encoding; } public void
bin = new Filebody (file);Stringbody encapsulates a parameter of type stringStringbody keybody = new Stringbody (key, Contenttype.text_plain);Stringbody typebody = new Stringbody (type, contenttype.text_plain);Addpart Pass the argument and specify the parameter nameHttpentity reqentity = Multipartentitybuilder.create (). Addpart ("Pic", bin). Addpart ("key", Keybody). Addpart ("Cardtype", Typebody). Build ();Httppost.setentity (reqentity);Httppost.setconfig (config);Perform network requests and
transformation of the gray scale distribution 1 to the right (that is, The probability of each grayscale value appearing is to be the same, so that you can find some details that are hard to see with the naked eye, 2 (as the reader sees it). When it comes to this, it's usually over, but do we really understand? How to better understand it?The following is a brief introduction of how I understand. Http://www.cnblogs.com/mewrhje/originally did not want
let's look at how to implement the AOP feature that prints the current time before and when the method is called.
Change the transform method of transformer first
Public byte[] Transform (ClassLoader loader, String className,
ClassByte[] classfilebuffer) throws Illegalclassformatexception {
Byte[] result = Classfilebuffer; Defining a new byte-code storage variable
This changes the class by modifying the byte code
the Code Inspector tool in ABAP to measure the loop complexity of the codes:Refer to my ABAP blog for specific steps:
A Small tip To get all transparent tables used in ABAP code
Useful tips regarding ABAP code inspector that is not know
Java can measure the ring complexity with a tool called Sourcemo
Com.ray.ch01;public class Boxer extends person {public void fight () {}}Package Com.ray.ch01;public class Singer extends person {public void sing () {}}Inheritance: is-a relationship, the important means of code reuse.3) at the configuration level:For example, we usually use the framework, usually have a configuration file, we can put these configuration files centrally managed, and then reused4) at the business level:For example, there is a multi-sy
Blog Source: http://www.fhadmin.org/webnewsdetail4.htmlSystem Introduction:1. The system uses the main SSM framework JSP JSTL Bootstrap HTML5 (PC browser)2.springmvc +spring4.3.7+ mybaits3.3 SSM Common Java Web (non-MAVEN, pom.xml file) database: MySQL3. Development tools : MyEclipse Eclipse idea is available without restrictions. My side MyEclipse 2014 lead out of the project source--------------------------------------------------------------------
Introduction:1. The system uses the main SSM framework JSP JSTL Bootstrap HTML5 (PC browser)2.springmvc +spring4.3.7+ mybaits3.3 SSM Common Java Web (non-maven, with pom.xml files) Database:MySQL3. Development tools : MyEclipse Eclipse idea is available without restrictions. My side MyEclipse 2014 lead out of the project source--------------------------------------------------------------------------------------------------------------- ----------Busi
Introduction:1. The system uses the main SSM framework JSP JSTL Bootstrap HTML5 (PC browser)2.springmvc +spring4.3.7+ mybaits3.3 SSM Common Java Web (non-maven, with pom.xml files) Database:MySQL3. Development tools : MyEclipse Eclipse idea is available without restrictions. My side MyEclipse 2014 lead out of the project source--------------------------------------------------------------------------------------------------------------- ----------Busi
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.