than FunctionIi. Conditional compilation1. Definition# If (condition)# Elif (condition)# Endif# Ifdef# Endif# Ifndef# EndifThis definition is generally used at the beginning of the header file, which can prevent files from being # include multiple times and control performance.2. conditional compilation is generally used together with macro definition. It can be used to compile a piece of code. Sometimes, when the conditions are not met, Conditional compilation can be used without compiling a p
initialization
When the program starts, all classes and categories in the project will be loaded, and the + load method for each class and category will be called back, and only once
When an object is created using a class for the first time, the + initialize method of the current class is called, that is, the initialization object, so that the created object can be used
Rule:
When the program starts, the system first loads the parent class and then the Child class (first calls the + load me
class.
1> if this Protocol is only used in a class, the protocol should be defined in this class.
2> if this protocol is used in many classes, it should be defined in a separate file.
7. the category can be defined in a separate. h and. M files, or in the original class.
1> generally, they are defined in separate files.
2> category defined in the original Class
Protocol application: proxy Mode
As mentioned above, the platform that uses the Protocol method to declare can design some proxy m
toString (int i,int radix): The I value of a certain binary, Converted to a string representation. Radix: binary Other decimal: public static int parseint (String s,int Radix) : Converts a binary string representation of S to a decimal int value. Radix is the binary number; Automatic packing and disassembly of 5.jdk5:1. Auto-Boxing: Converts the "basic data type" to the corresponding "wrapper type";Integer intobj = 10;2. Automatic unpacking: The "package type" is converted to the correspondi
, which can be explicitly caught by the exception//You can also ignore the exception completely and give the method caller the exception to handle Throw NewRuntimeException ("A has a value greater than 0, does not meet the requirements"); } } }Custom exception ClassesIn general, a program rarely throws a system exception on its own, because the class name of the exception usually contains useful information about the exception. So when you choose to throw an exception, y
-abstract methods. There is no implementation method in the interface.5. The variable defined in the interface is the public static final type by default, and must be given its initial value, so the implementation class cannot be redefined or changed.6. Variables in abstract classes are friendly by default, whose values can be redefined in subclasses or re-assigned.7. The methods in the interface are public,abstract type by default. ConclusionAbstract class and interface are two of the ways in
local variables, the function can directly manipulate the member variables of a class3, the function call is directly through the function name to callObject method:1, which is subordinate to the object of the class, only the object of that class is called2.member variables can be accessed directly in the object method, because they are all objects that belong to the class.Creation of ObjectsObject * obj = [ class name new]; 1. Createstorage space for class objects in the heap2.Initialize all m
%@8NSLog (@"arr1 =%@", arr1);9 Ten //create an array with only one element OneNsarray *ARR2 = [Nsarray arraywithobject:@"1"]; ANSLog (@"arr2 =%@", arr2); - - //Create an array with multiple elements the //Nil represents the end of the array assignment, so Nsarray cannot store nil, and "empty" is required to use [NSNull null] - //most common ways to create (common notation) -Nsarray *ARR3 = [Nsarray arraywithobjects:@" One",@" Both",@1, [NSNullNULL
, IOException {doget (request, Response);}}Is it garbled? Answer:Will not garbled, because GetBytes code will check GBK, browser decoding will use GBK. So it won't be garbled!2. If you specify the encodingResponse.getoutputstream (). Write ("China". GetBytes ("Utf-8"))Must be garbled, because the encoding uses UTF-8, the browser decodes the use of the default GBK and therefore garbledHow to resolve:Tell the browser to decode using UTF-8 encoding:Use//Notify browser to use Utf-8 decodingResponse.
classpath=%classpath%; E:\apache-tomcat-6.0.14\lib\servlet-api.jar; E:\code>javac Firstservlet.javafirstservlet.java:6: Error: Unable to find Symbol response.getwriter (). Write ("Hello world!"); ^ symbol: variable response Position: Class FirstServlet1 error E:\code>javac firstservlet.javae:\code>javac-d. Firstservlet.javae:\code>At the end of the run, there is a Com-->itheima-->firstservlet file. Put this folder under Tomcat's WebApp to run.Then build web-in
AptanaThe Code hints for javascript,html,css in eclipse or myeclipse are poor ... So we have chosen this framework.Installation steps for Aptana:1. You need to download the Aptana plugin.2.Create a new Mydropin folder in the installation directory in Eclipse.Create a new Aptana folder in this folder ...Create a new Eclipse folder in the Aptana folder ...Copy the following two folders from the Aptana plugin into the new Eclipse folderCreate a new link folder in the installation directory of Eclip
(request.getparameter ("Thispage")); int ROWPERPAGE=5;//2. Method of invoking the service page page=service.findcustomerbypage (thispage,rowperpage); Request.setattribute ("page", page);//3. The request is forwarded to PageList.jsprequest.getRequestDispatcher ("/pagelist.jsp"). Forward (request, response); public void DoPost (HttpServletRequest request, HttpservleTresponse response) throws Servletexception, IOException {doget (request, Response);}} 3.service implements the main functions of the
Black Horse Basic Stage Test Question: prompt the user to enter the account name. The account name must be longer than 5 and start with a letter. If not, prompt the user to re-enter until the entered account name meets the requirements .,
Code:
Package com. swift; import java. util. required; public class XunhuanLogin {public static void main (String [] args) {/** prompt the user to enter the account na
Reproduced in: http://www.itxuexiwang.com/plus/view.php?aid=148A thread is a task that can be executed in parallel in a program.The Java runtime always executes by selecting the highest-priority thread that is currently in the ready state. If several ready threads have the same priority, the time slice method will be used to take turns to allocate the processor.The difference between a process and a threadThe process belongs to a separate running program, and the thread is a branch inside the pr
given index value. EQ (0) is the first TR element to get. Inside the parentheses are the index values, not the number of element permutations.7,: GT (Index)usage: $ ("tr:gt (0)")return value Collection elementDescription: Matches all elements that are greater than the given index value.8,: LT (index)usage: $ ("Tr:lt (2)")return value Collection elementDescription: Matches all elements that are less than the given index value.9,: Header (fixed notation)usage: $ (":Header"). CSS (" Background ","
between the two cases. Some information is suggested. When synchronization is required, use Hashtable and vice versa with HashMap. However, due to the need, HashMap can be synchronized, HashMap function than hashtable many other functions, and it is not based on a stale class, so some people feel that in all cases, HashMap priority over Hashtable.Second, for the Java Collection frameworkThe comparison between them:
is ordered
Do you agr
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.