Java applet ball Big Battle (based on Java thread implementation)
first, the basic functions of the game:
1, their own small ball can be moved with the mouse to change the coordinates;
2, the enemy ball constantly moving in the interface
3. When the enemy ball is detected colliding with each other, the ball will bounce off
4, when our small ball collision with the enemy, we will judge the radius of the two
The main introduction is operators, and mathematical functions as well as ternary operators: PackageTestbotoo; Public classTest1 { Public Static voidMain (string[] args) {intA = 122;SYSTEM.OUT.PRINTLN ("The result of calling operation is:" +operation (a));//call the method defined below }; Public Static intOperation (intv) { intXe = v + 1; intand = 10; returnXE; }}operator, basically similar to Python, except for the use of the expression and, by | | Represents or:
system easier to operate and more powerful.Better ExtensibilitySince the object that initiated the command is fully decoupled from the specific implementation, it is easy to extend the new command, just implement the new command object, then set the specific implementation object to the Command object when assembling, and then you can use the command object, and the existing implementation does not have to change at all.Original link http://www.cnblogs.com/
First, the new Java file automatically generates the main functionAlthough it is only a simple thing, but it should still be someone do not know, each new Java file to manually enter public static void main (String args[]) {}, it is very troublesome, in fact, eclipse can automatically generate this line, Only most Java files have no main
be reused.ADP non-cyclic reliance principleThe ring is not allowed in the dependency diagram of the package.SDP Stability Dependency principleTo rely on in a stable directionSAP Stability Abstraction principleThe degree of abstraction of a package should be consistent with its degree of stability. The main function of the interface is to achieve unified access, is created when the object is created with the interface, "Interface Name" "Object Name"
You can create an anonymous method by lambda expression. But most of the time, this method may already exist, and you can use a function reference. This will make the code structure clearer.We know that the greedy algorithm inside, a common step is to sort. Suppose you have the following backpack class:Class package{ private int weight; Ignore setter and Getter}We have a backpack array package[] packa
for Java. All the keywords are lowercase1) Goto JumpGoto retains the keyword, but has no effect. Structured programming completely does not require a goto statement to complete a variety of processes, and the use of the goto statement tends to make the program less readable, so Java does not allow Goto jump.2) const staticThe const reserved word, which is a type modifier, cannot be updated with objects dec
define the native C + + function. 2, compile Hello.java with Javac to generate Hello.class. 3, using Javah with-JNI parameter compilation Hello.class generate Hello.h file, the file defines the function prototype C. It is necessary to implement the C function. 4, create HELLO.C, implement Hello.h defined function. 5,
What is the Java termination function?
For an object, the Java termination function performs the final validation work. This is in contrast to the Java structure function, which creates and initializes a
A regular expression is a formula that matches a type of string in a pattern that consists of ordinary characters and some metacharacters (metacharacters). Ordinary characters include uppercase and lowercase letters and numbers, while metacharacters have special meanings, whether they are. NET platform or Java platform, the regular expression is the same meaning, the following is our main analysis of the Java
What do you need to know about Java 8 function programming?
Functional Programming and object-oriented design methods have different ideas and methods. Here, I will briefly introduce some features and differences between functional programming and object-oriented programming.
When understanding the phrase "function as a first-class citizen", let's first look at a
A regular expression is a formula that uses a pattern to match a type of string, and the regular expression consists of some ordinary characters and some metacharacters (metacharacters). Ordinary characters include uppercase and lowercase letters and numbers, while metacharacters have special meanings, whether they are. NET platform or Java platform, the meaning of the expression is the same, the following we mainly analyze the
Java Basics--functions
the basic use of a function
Definition of function
function is a very important part of computer programming, and it is one of the most basic elements in programming. A function represents a generic process that provides services to the outside world
Sap rfc function creation Java program call learning summary step by step graphic and text, saprfc
Preface
The company will soon receive an interface between a project and SAP. The boss asked us to engage in SAP. First, we had contact with SAP, but we had never been engaged in development. This week we focused on this part.
What do I say about the SAP system? Even though it is a tear, the following is the
A detailed introduction to the registration process for JAVA JNI functions
When we call native code in Java, it's usually done through JNI, All we need to do is load the local. So library file in the Java class and declare the native method, and then call it where it needs to be called, as for the concrete implementation of the native method in
Just looked at C + +, his main function must return an int value, used as a status indicator, Java provides a similar function no, void as the return value what is the intention?In Java, the main () method is the entry method for a Java application, that is, when the program
Java Network Programming-TCP communication and simple file upload function instance, tcp File Upload
TCP communication needs to be clarified:
Tcp communication is connection-oriented. You need to start the server and then the client.
Both the client and the server must create a socket object. The client must specify the server socket (ip + port), and the server must specify the service port.
Socket client_s
When it comes to customizing callback functions when you're doing Android custom controls, think about the technology you're not looking for, and go back to the question of callback functions in Java again. Unfortunately, too many cluttered posts and blogs on the web are all spinning around, and that's the "C callback function ...." Pointers ..... java .... ", it
One.For main function public static void main (string[] args):The main function is a fixed-notation function, which is also a general function, but where is it special?Fixed format Why do you write this?Public: Because the permissions must be the largest, small permissions, bad for the virtual machine, if written to pr
mentioned in this article to access the corresponding domain database to obtain the correct domain query function! Before running the program, make sure that you have installed jdk1.3 and configured relevant parameters.
*/
Import Java.net .*;
Class search
{
Public static void main (String [] args)
{
Try
{
InetAddressAddress=InetAddress. GetByName (args [0]);
// Obtain the ip address or domain you want to query
System. out. print
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.