cool java programs

Learn about cool java programs, we have the largest and most updated cool java programs information on alibabacloud.com

Reprint-Write high-quality code: 151 Suggestions for improving Java programs (3rd: Classes, objects and methods ___ recommended 31~35)

requirements of the interception class (Interceptor class or handle class or Hook method) , and then look at the problem, is this scenario impossible to appear?You may find that such a scenario does not occur, as long as the system runs, it is impossible to affect the project.That's because the code we're showing here is simple, it's easy to penetrate, there are more than one or two constructors in a project, and the relationships between classes are not so simple, and to glance at one can see

Use JVISUALVM to remotely observe Java programs and JVISUALVM plugins [go]

JVISUALVM is the JDK's own tool for monitoring the health of the JVM, using JVISUALVM to view the operation of the JVM, the GC situation, the running of the thread, the condition of classes and instances in memory, and so on.Using JVISUALVM to remotely observe the Java program, the original link: http://blog.iamzsx.me/show.html?id=394002Sometimes, we may need to remotely view the operation of a Java program

2nd java sample programs

2nd java sample programs-general Linux technology-Linux programming and kernel information. The following is a detailed description. For programming languages, variables are the most basic concept. You may know that a variable is a memory location with a name and can be assigned a value. In addition, the variable value can be changed during the running of the program. The next program will introduce how to

Java beginners practice tutorial-network programs

the port OutputStream s1out = s1.getOutputStream (); BufferedWriter bw = new BufferedWriter ( New OutputStreamWriter (s1out )); // Send a string Bw. write ("Welcome to baibaiquan software project research office! \ N "); // Close the connection, but it is not the socket of the server. Bw. close (); S1.close (); } Catch (IOException e ){ E. printStackTrace (); }}}} Download href = "http://java.chinaitlab.com/download/07072213182935.rar" target = _ blank> package the above example The execution

Creation and editing of Java programs

Creation of 1.JAVA projects and command editingOpen the Java program, select the small triangle next to the Create button on the toolbar, select Create Java project in the drop-down menu, enter the project name in the dialog window that appears, and select the available resource bundle in the JRE using the execution environment. If the javase1.7 version is instal

Open-source code-publishing Java Desktop programs

Open-source code-publishing Java Desktop programs I took a copy of the open source code of the desktop tool, repaired, modified, and modified it, and ran it on elipse. I felt good, but it was dumb to release the application. I don't know how to publish it! Oh, it's really a little Java! If it is the Microsoft camp, it will be compiled into exe directly. However,

Reprint-write high-quality Code: 151 suggestions for improving Java programs (3rd: classes, objects and methods ___ recommended 41~46)

method.Back to top recommended 46:equals should consider a null value scenarioContinuing with the 45 suggested questions, we solved the question of the reflexive nature of the overwrite equals, is it perfect? To refactor the main method:public static void main (string[] Args) {person p1= new person ("zhang san"); Person p2= the new person (null);/* no changes in other parts, no more repeating */}Very small changes, you must know that the result is the package "null pointer" Except

Reprint-Write high-quality code: 151 Suggestions for improving Java programs (5th: Arrays and Collections ___ recommendation 60~64)

the set can be automatically sorted, with the following code:1 public static int Getsecond (integer[] data) {2 //Convert to List 3 listRemove the repeating elements and arrange in ascending order, which is implemented by the TreeSet class, and then use the lower method to find the value less than the maximum value, you see, the above program is very simple? What if we were writing our own code? At least two times to calculate the value of the second, code complexity will be grea

Reprint---Write high-quality code: 151 recommendations for improving Java programs (3rd: Classes, objects, and methods ___ recommendation 41~46)

method.Back to top recommended 46:equals should consider a null value scenarioContinuing with the 45 suggested questions, we solved the question of the reflexive nature of the overwrite equals, is it perfect? To refactor the Main method:public static void Main (string[] args) {person p1= new person ("Zhang San"); Person p2= the new person (NULL);/* No changes in other parts, no more repeating */}Very small changes, you must know that the result is the package "null pointer" except

Basic concepts of Java programs

altogetherreturn x + y;}/*** Implementation of an addition calculation operation for three integer numbers* @param x operation number One* @param y operation Digit Two* @param z operation number Three* @return The addition calculation results of three integer data*/ Public Static int Add (int x, int y, int z) {//is not the same as the number of arguments to the previous add () methodreturn x + y + z;}/*** Implement an addition calculation operation for two decimals* @param x operation number On

Talk about one of the most wonderful Java programs I've ever interviewed ape!

to face his phone rang, and then directly connected, he did not say he went to answer the phone, saying that he opened the door directly out ...Then I waited at the door for a few minutes, he did not stop the meaning, maybe he also know that he is not very technical, and then I was impatient, directly to the front desk to get rid of his sister. The front desk is also out of courtesy, let him go after the fight, who knows the 10 minutes did not stop the meaning of ...Finally do not know how long

Use exe4j to package Java programs into EXE format

Address: http://blog.csdn.net/fog911811/article/details/6151700 Because of this need, I have previously searched many web pages on the Internet to convert Java programs into executable (exe) programs, but they are not satisfactory. After a while, I found this good thing, exe4j. I personally tried the knife and found it really simple and easy to use. Write it dow

Packaging Java programs with exe4j

Tools: exe4j Software (Cloud Inventory) Jar packages for Java programs that can run Open our already installed exe4j software, first of all see is a welcome interface, we directly "next" on it; 2In the second step we select "JAR in EXE mode" and then "next"; The third step needs to enter the program's abbreviated name and specify the output directory, is the program's Save directo

Write high-quality code: 151 recommendations for improving Java programs--[78~92]

Write high-quality code: 151 recommendations for improving Java programs--[78~92]hashmap hashcode should avoid conflict multithreading using vectors or hashtableVector is a multithreaded version of ArrayList, and Hashtable is a multithreaded version of HashMap.Non-stable Sort recommended listSort the set of changes Set=new TreeSet Using TreeSet is to automate sorting, even if the modification i

Garbage collection mechanism for Java programs

Show Recycling garbage analysis?the traditional c,c++ language requires the programmer to reclaim the allocated memory.This is done by programmers, which can cause problems, because programmers do not always know when memory should be released, and if some of the allocated memory is not recovered in a timely manner, it can cause the system to slow down, or even program paralysis, which is called a memory leak.Cons: 1) The program forgets to reclaim useless memory in time, which causes memory lea

The differences between Java and C + + programs in compiling and running

Java, C + + are all high-level languages, and the computer can realize that only the machine code (that is, binary), so the high-level language must be directly or indirectly converted into a compilation, to run:For the advanced computer languages such as C + +, their compilers (such as CC commands under UNIX, CL commands under Windows) can compile the source code directly into machine code that can be recognized by the computer, such as EXE, DLL, and

General Script 2 for starting java programs in linux, linuxjava

General Script 2 for starting java programs in linux, linuxjava 1. start. sh #! /Bin/bashCd 'dirname $0' BIN_DIR = 'pwd' Cd .. DEPLOY_DIR = 'pwd' CONF_DIR = $ DEPLOY_DIR/conf SERVER_NAME = 'sed '/server. name /! D; s/. * = // 'conf/server. properties | tr-d' \ r'' SERVER_PORT = 'sed '/server. netty. port /! D; s/. * = // 'conf/server. properties | tr-d' \ r'' If [-z "$ SERVER_NAME"]; then SERVER_NAME =

Reprint---Write high-quality code: 151 recommendations for improving Java programs (2nd: Basic type ___ recommended 26~30)

After reading the above two rules, we'll look at this example, and we'll see that the problem is on the structure of the argument, the default seed of the Random class (no parameter construct) is the return value of System.nonotime () ( JDK1.5 version before the default seed is the return value of System.currenttimemillis (), note that this value is the number of nanoseconds from a fixed point in time, different operating systems and hardware have different fixed point of time, that is dif

Java calls external programs and specifies the working path

This blog post'sCodeThe premise is to understand how to use Java to call externalProgramOf course, the Code also reveals how to use Java to call external programs. The working path of the external application has changed when Java (similar to other languages) calls an external application. I encountered this problem

Oracle calls external programs using Java source

Oracle Use Java source Calling external programsDemandOracle calls third-party external programs. Oracle uses SQLULDR2 to quickly export large quantities of data and then use WinRAR to compress and send messages.Original codeJava sourceCreate or replace and compile Java source named Jv_run_extpro asImport java.io.*;Import java.lang.*;Import java.util.*;Import jav

Total Pages: 15 1 .... 11 12 13 14 15 Go to: Go

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.