Garbled is a more common problem in the Java EE. If you encounter one or two problems, you can use the new String (Request.getparameter (XXX). GetBytes ("Iso-8859-1"), "UTF-8") to resolve. When you encounter many situations, it is best to use a
ordered list: sorted by key value. When you delete the chain header, delete the minimum (/maximum) value, and when you insert it, search for the insertion position. when inserting, you need to compare O (N), average O (n/2), delete the minimum
The instanceof keyword is used to determine whether a reference type variable refers to an object that is an instance of a class (or interface, abstract class, or parent Class).
Instanceof is a Java two-dollar operator, and ==,>,
String s =
The definition of state: different states, different behaviors, or each state has its corresponding behavior.
When to use state mode
State mode is more useful in actual use, which is suitable for "switching status". Because we often use the IF
Java thread synchronization essentially conforms to a logic: lock------> Modify------> Release lock
1. Sync code block
Examples are as follows:
public class SyncBlock {
static class Datawrap {
int i;
}
Static Class
Visitor definition: An action that acts on each object in a group of objects. It allows you to define new actions that work on these objects without changing the objects themselves.
In Java, the visitor pattern is actually a separation of elements
I. Algorithm descriptionSelect sort: For example, in a unordered array of length n, the first pass through n data, find the smallest of the number and the first element of the exchange, the second traversal of the remaining N-1 data, find the
One, what is encapsulation?
Encapsulation is the privatization of attributes, which provides a public way to access private properties.
The approach is to modify the visibility of the property to restrict access to the property and create a pair
This tool is simpler to use with another tool for file transfer, less nonsense, on code
Import Java.net.URL;
Import java.net.URLConnection;
Import Java.io.File;
Import Java.io.InputStream;
Import Java.io.FileOutputStream;
Import
The example in this article describes how Java obtains different data from two arrays. Share to everyone for your reference. The implementation methods are as follows:
public static list compare (t[] t1, t[] T2) {list List1
= arrays.aslist
This control inherits from Surfaceview and plays video using MediaPlayer.
Small video Playback interface
Movieplayerview.java
Import java.io.IOException;
Import Android.content.Context;
Import Android.media.AudioManager;
Import
This article illustrates the method of translating Java implementation list, collection and array. Share to everyone for your reference. The implementation methods are as follows:
Copy Code code as follows:
Package test;
Import
Vector and ArrayList Comparisons
Sometimes it is better to use a vector, sometimes ArrayList better, not accurate and easy to give the answer, because depending on the circumstances, there are four main factors to consider:
1:api2: Sync
Fair algorithm, scrambling arrays
This is a few days before the interview met a problem, see this problem first thought of the Shuffle program:
Method One: Shuffle the procedure principle
In the shuffle method in the collections class in the Java.
This always has something to represent the current object of the class, like the this pointer in C + +, the This keyword in Java is a reference that represents the current object. It has three main functions: 1, which calls other construction
First, the problem definition:
Ask the next there is an array, the values in these arrays have their own weight, how to design efficient priority to remove the number of high weight??
For example:
Copy Code code as follows:
Weight: 8
In this paper, the methods of destroying objects in Java are analyzed in detail. Share to everyone for your reference. The specific analysis is as follows:
Basic data type variables in Java and name reference variables for objects, such as defined
We want to execute the Execute (S1,S2) method in Javascriptmethods.js in Java, javascriptmethods.js the contents of the file are as follows:
function execute (S1, S2) {return
s1 + s2;
}
First you need to define an interface that gives
read files by row
Package test;
Import java.io.*;
Import java.util.*;
public class Readtest {public static list first_list;
public static list second_list;
Public Readtest () {first_list = new linkedlist<> ();
Second_list
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