Java interview Some code-writing topics

Give a string, replace more than two _ to one, such as "Hello__world____are__you_ok?", should be treated as "Hello_world_are_you_ok?", the sample code is as follows: Using regular expressions, a word-out version:public static void Main (string

Java EE: Second, graphic Cookie (cookies)

DirectoryJava EE: First, illustrated HTTP protocolJava EE: Second, graphic Cookie (cookies)Java EE: Three, graphical session (sessions)OverviewI. OverviewSecond, detailed introduction of the cookie transmission processThird, talk about the role of

Java date format conversion, plus and minus, etc.

Converts a string into a dateSimpleDateFormat re = new SimpleDateFormat (String formate);----: YYYY-MM-DDSystem.out.println (Re.parse ("1990-02-02"));----Fri Feb 00:00:00 CST 1990Convert Date to StringSimpleDateFormat sfdate = new SimpleDateFormat

10 Line Java Code implementation recently used (LRU) cache

In a recent interview, I was asked several times how to implement a least recently used (LRU) cache. Caching can be done through a hash table, but increasing the size limit for this cache can become another interesting issue. Now let's see how it's

Java static methods cannot be overwritten

// static methods cannot be overwritten?/*class super{???? Static String name () {???????? return "Mother";????}}?Class test02{???? public static void Main (string[] args) {???????? Super S3 = new super ();???????? System.out.println (S3.name ());??

JAVA Enumeration (list)

Enumeration is an interface class in Java.util that encapsulates methods for enumerating data collections in enumeration.Public interface Enumeration { /** * Tests If this enumeration contains more elements. * * @return true if

Relive thinking in Java

1. High precisionBigInteger, BigDecimal support for arbitrary-sized numbers can not be used operator operation speed relative to int, float slightly slower2. Object Scope{ new String ("AAA");}Outside of this stack, the reference S has gone beyond

Configuration of Java Environment variables

Installation path for JAVA_HOME:JDKPath:%java_home%/binTest: Enter Javac under DOS commandJdk:java Development Kit Java Development KitJre:java Runtime Environment Java Runtime EnvironmentJvm:java Virtual machine Java VMFeatures of the Java language:

Generic instances of Java problem inheritance comparable

Because I looked at the old books, I didn't learn the generic content. Causes the compiler to write code that always prompts for a generic type parameterization. Today, we finally found an example:1 PackageComparableclass.main;2 3

Java Export Excel (multi sheet supported)

First, Batch export:/*** * @Title: Expexcel * @Description: Bulk export of customer information *@param @paramparams *@param @paramRequest *@param @paramResponse *@param @throwsException *@returnvoid *@throws */@RequestMapping ("Expexcel")

Java timed Tasks

First, IntroductionIn Java programming, it is sometimes necessary to perform tasks at a specified time or at a specified frequency, using the timer and TimerTask timers.Timer classIn the tool class timer, there are four construction methods, each of

Java Methods for processing XML

Dom (Document Object Model) API: As the name implies, read and write XML based on a DOM book. Public Static voidMain (string[] args)throwssaxexception, IOException, parserconfigurationexception {documentbuilderfactory

Java Learning Site Summary "Memo"

Java Learning websitehttp://www.javaxxz.com Java Learner Forum, the resources are very many, suitable for beginners.Http://www-900.ibm.com/developerWorks/cn/java/index.shtml IBM's Java theme-The Forever blue Gianthttp://www.huihoo.com Gray Fox Power-

Java rewriting equals and hashcode considerations

Why rewriteequalsMust be rewritten when thehashCodeYou may learn from a number of tutorials: In Sun's official documentation, "If you redefine the Equals method, you must redefine the Hashcode method so that the user can insert the object

Java Properties Tool Class

1, Java Properties Tool class is located in Java.util.Properties, the use of the tool class is extremely simple and convenient. First the class is inherited fromHashtableThis lays down the nature of the properties class is actually a hashtable, then

Java Programmer's Way of practicing 02--nio

The most significant change in JAVA7 is the I/O API---NIO21. He completely replaced the Java.io.File with the file system.2. The tower provides a new asynchronous processing class that allows you to perform file and network I/O operations in a

Java Object Representation 2:xstream implementing XML for an object

The previous article referred to the use of Java native serialization to represent an object. Summarize the pros and cons of this method of object representation:1, Pure Java environment in this way can work well, because it comes with Java, and

The function of Java and JAVAC commands

javac used to compile Java programs, for example, I wrote a Server.java file, first through the command line into the path of the. java file,Then, by entering javac Server.java command line to complete the compilation, the compilation will generate

Resolution-java.lang.OutOfMemoryError:unable to create new native thread

Who often encounters such a problem. The general idea is to change the configuration startup parameters, trying to increase the parameters, I think, which can avoid memory overflow. But the effect is basically wrong. I found an article on the

Java package and javapackage

Java package and javapackage Directory. For example, in the current directory, B is a folder, and a is a folder. B. java source code is as follows: Package B; import a. *; public class B {public static void main (String [] args) {A = new a (); A.

Total Pages: 6206 1 .... 4085 4086 4087 4088 4089 .... 6206 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.