them in bulk and reclaim the memory at the right time (for example, by pressing the pause key or the level switch). Mono's memory recovery is done automatically in the background, and the system chooses the right time for garbage collection. At the right time, you can also manually call System.GC.Collect () to suggest that the system do a garbage collection.It is important to note that the call here is really just a suggestion, that the system may be recycled after a period of time, or it may b
; //newobj.i = this.i; //return NEWOBJ; //implementing Deep Replication-Mode 2: Serialization/deserializationBinaryFormatter BF =NewBinaryFormatter (); MemoryStream Ms=NewMemoryStream (); Bf. Serialize (MS, This); Ms. Position=0; returnBF. Deserialize (MS); } ...... } [Serializable] Public classA { Public stringMessage ="I am the original a"; }View Code
PS: generally inheritable types should avoid implementing the ICloneable interface , because doing so would force a
1, b/s software system structure
Network software system development including C/s and b/s two kinds of architecture, can carry out the same business processing.
C/S is client/server abbreviation, both client and server structure, like commonly used QQ, and so on network software.
b/S is brower/server abbreviation, both browser and server structure, only need to launch a browser.
Our mobile applications are all part of the C/s structure.
2, the basic concept of network
system1) Resolve name conflict issues2) Easy class Managementfull-Limit naming of classes: Package name + class nameCp: Mount PathImport Imports date Gets the current time7.public source file can only have one Public common class name and file name consistent8.Javac Java source files compiled into a class file can compile multiple files at a time9.Java program starts from main method10.Java There can be more than one Java class in a source file . However, there can be only one Multiple sou
In a template-specific version of a call, the argument type must exactly match the formal parameter type of the special version function, and if it does not, the compiler instantiates an instance for the argument template definition.
Lift a chestnut:
Template
Again, the argument type must be the formal parameter type of the special version function.
Exact Match, even if there is no const in the front of the argument, and the template parameter does not constitute a special. The sp
) { for(intj = 0; J ) {System.out.print (Data[i][j]+ " "); } System.out.println (""); } }}The results of the program run as follows:6. Using the stream to print an array, we can convert the array to a stream and print it out.code example: PackageCom.himi.printarray;Importjava.util.Arrays;/** Use stream to print an array * We can convert it to a stream and print it out. */ Public classStreamarray { Public Static voidMain (string[] args) {//Arraystring[] Arraystr =Newstring[]{"Java
12th. Graphical Interface Basics1. is that class the root of the Java GUI component? is the container Class A subclass of component? Which class is the root of the swing GUI build?Java.awt.component is the root of all Java GUI component classes.A container class, such as JFrame, is a subclass of a component.JComponent is the root of the Swing GUI component class.2.AWT components different from swing build?The components of AWT are heavy and swing components are lightweight.3.You can add a button
private, create static final class object in Class =new class (); ___ Singleton mode
Inherit extends
The default inherits the properties and methods of the parent class public, implicitly inheriting private, and prohibiting subclass access
Method and property with the same name override, to subclass first
Polymorphic
Parent class object =new subclass instantiation (); Down transformation
Subclass up to parent class (cast)
Abstr
1. Can a button trigger the windowevent? Can a button trigger MouseEvent? Can a button trigger ActionEvent?JButton can produce mouseevent and ActionEvent. Cannot trigger WindowEvent2. Can a single source have multiple listeners? Can a listener have multiple sources? Can a listener make its own listener?YES. YES. YES3. Can internal classes be used in other classes that are not nested in him?Objects of an inner class is often created in the outer class. But the can also create an object of a inner
request.
HTTP is text-oriented, so each field in the message is a number of ASCII strings, so the length of each field is indeterminate.
There are two types of HTTP messages in total, requesting messages and responding messages.1) Request message2) Response message
Both the request message and the response message can be divided into three parts.1) Start line2) Header LineMy habit is to call the two parts above, the message header. The following section is called the newspaper style
1. Class loadingBootstrap ClassLoader-Boot (also known as primitive) class loader, which is responsible for loading Java's core classes. Extension ClassLoader-the extension classloader, which is responsible for loading the class pack of the jar in the JRE's extended directory (Java_home/jre/lib/ext or specified by the Java.ext.dirs system properties). System ClassLoader-Systems (also known as applications) ClassLoader, which is responsible for loading-classpath or Java.class.path System Properti
1, how to get the current working directory?String path=system.getproperty ("User.dir");2. What is the difference between string x = "abc" and string x = new String ("abc")?String x= "abc"; the x variable points to a string object in the data segmentstring x = new String ("ABC") points to a string object in the heap, which must be copied into the object using a string in the data segment as a template;3. What is the difference between string and StringBuffer?String Immutable property, when we ch
This is only a brief description of TCP sockets, let us first look at how to write a simple server, here first with Linux C to achieve. Time . h > int main (int argc, char** argv) { int listenfd, CONNFD; Socketlen_t Len; struct sockaddr_in servaddr, cliaddr; Char Buff[maxline]; time_t ticks; LISTENFD = Socket (af_inet, sock_stream, 0); Bzero (servaddr, (SA *)servaddr, sizeof (SERVADDR)); Listen (LISTENFD, Listenq); for (;;) { len = sizeof (CLIADDR);
operations, using for-in, for, while, and do-while for looping. Wrapping conditions and loop variable parentheses can be omitted, but curly braces on the body of the statement are required.(6.1) for in control flowLet Indivadulscore = [70,66,80,90,56,34]var score = 0For S in Indivadulscore{If s>60{Score + = 20}else{Score + = 100}}Note: Look at the differences in the syntax of the control flow you wrote earlier(6.2)? indicates an optionalvar optionstring:string? = "Hello,world"Optionstring = = N
the callback function.Interface Intcompare{public Boolean cmp (int x,int y);} Class CMP1 implements Intcompare{public boolean cmp (int x,int y) {if (x > Y) {return true;} Else{return false;}}} Class CMP2 implements Intcompare{public boolean cmp (int x,int y) {if (x > Y) {return false;} Else{return true;}}} public class selectsort_s {public static void Selectsort (int[] A, intcompare cmp) {for (int i = 0; i The above example defines an interface intcompare that is used to compare size, whic
to let the waiting person wake up **/classStudentextendsThread {Private intscore; @Override Public synchronized voidrun () {Try{System.out.println ( This. GetName () + "Start exam ..."); Thread.Sleep (3000); System.out.println ("The exam is over and the quiz begins."); Thread.Sleep (3000); Score= (int) (Math.random () * 101); System.out.println ("The quiz is over, you can check your grades now."); This. Notify (); } Catch(interruptedexception e) {//TODO auto-generated Catch blockE.printstacktr
provided by a server.A port number is a place of access to a service that distinguishes multiple services on the same physical computer.Sockets are used to connect the client and server, and each communication session between the client and the server uses a different socket.The TCP protocol is used to implement a connection-oriented session. The network-related features in Java are defined in the java.net package.Java uses the InetAddress object to represent an IP address with two fields: Host
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.