I haven't updated my blog for a long time, because I started to learn about Java programming ideas during this time. I hope I can have a deeper understanding of Java so that I can process androidProgramIt can be handy.
Today, when I saw containers in Java, I found some useful things, that is, the comparison of various containers in
1. A simple implementation of a mutable parameter listWhen a method is called, the number of arguments or the type of the method is unknown, which is called a mutable argument list. In previous Java code, you could use an object array to implement such a function. Because all classes are directly or indirectly inherited from the object class. Varargs.java
Package sample;class a1{}Public class V
), this partition generally does not do GC, if necessary to add additional parameters when the Java boot:- XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled ) This is why the application container such as Tomcat to redeploy the application, Causes a memory leak.The following is a list of some bad programming paradigms that lead to generalized memory leaks:
Get the hash table, and go to Riga
Java container (list, set, map), javamapSimplified diagram of java container Class Library:
(Dotted boxes represent interfaces, while solid boxes represent common classes,
The hollow arrow indicates that a specific class implements the interface, and the solid arrow indicates that a Class Object indicated by the arrow can be generated for a class)
The main
City {Private Integer ID;private String name;the set and get methods are omitted}public class Country {Private Integer ID;private String name;Private listand City are a one-to-many relationship.the set and get methods are omitted}Then write the test class to run:public class Test {public static void Main (string[] args) {City City1=new City ();City1.setid (1);City1.setname (" Guangzhou ");City City2=new City ();City2.setid (2);City2.setname (" Shanghai ");ListListcity.add (city1);Listcity.add
the collection directly when it uses the quick fail iterator to collection over the iteration.
Note : The rapid failure behavior of iterators is not guaranteed because, in general, it is not possible to make any hard guarantees about whether or not to have a different step of concurrent modification. A quick fail operation will do its best to throw ConcurrentModificationException . Therefore, it is a bad idea to write a program that relies on this e
Recent company projects need to export CSV file, a colleague in the most original way to remove each record and then add "," to solve.But the customer later requires that this feature be added to each page. As a result, the problem is that there are too many separate writing codes, and it is not possible to determine which object is stored in the list, and you cannot get the property with the Getting method.I always thought he wrote the
page and interact with the Web page.The HTML file code of a webpage containing an Applet must contain a pair of tags such as An Applet is a Java Applet that is downloaded and run by a Web browser that supports Java by using the HTML file of the Applet. You can also run it through the appletviewer of the java development tool. An Applet cannot be separated from i
Big fish, py-Cauchy 05-16 11:15Want to learn Python can add 15472.51666, or attention: Python from the program Ape to Cheng ProgrammerThis May, the foreign two popular programming language Reference index list all appeared the very interesting change. In the TIOBE May programming Language list, Scala's thick, thin hair, entered the TOP 20. And in PYPL's May progr
DAY17---List collection in the Java languageA: List collection Overview: in Day16, we've already talked about a set of specific sets, and on that basis, we're going to say a little list set today. Mainly includes "ArrayList collection" and "LinkedList collection" and "vector collection", but currently we master and lea
Reference
Implementation of the Java simulated login QQ mailbox of azcat to obtain the friend list
In this article, I have been sleeping from to in the past few days. I am a good boy. I usually get into bed at, so I can steal food at night. hoho
In fact, it's boring. In fact, it's very Bt. The SNS website seems to offer the function of inviting friends overnight.
However, even happy users do no
Attributes of JavaBeans The attributes of JavaBeans and the attributes referred to in general Java programs, or the attributes of objects in all object-oriented programming languages are a concept. The specific embodiment of the attributes in the program is the variables in the class. In the JavaBeans design, attributes are subdivided into four categories based on different functions: Simple, Index, Bound
A list box can also be used to create a list box when information is presented to the user's list of multiple options, using JList.Package Com.beyole.util;import Java.awt.container;import Java.awt.gridlayout;import java.awt.event.WindowAdapter; Import Java.awt.event.windowevent;import Java.util.vector;import Javax.swing.borderfactory;import Javax.swing.jframe;imp
In the past, I often encountered these problems when I used to write questions. Sometimes I don't understand them very well. I found a good summary post on the Internet today and posted it to share it with you ~~~~~~
In Java, vector arraylist objects list:
SummaryIf operations such as stacks and queues are involved, you should consider using the list. For element
The Backstage Java program returns a list type and the foreground's flex reads it, what about this?
Returns the Java code for the list
1 package com.duduli.li; 2 3 import java.util.ArrayList; 4 import java.util.Date; 5 import java.util.List; 6 7 public class Testlist { 8
existing iterator.Many of the methods in the collections Framework interface are defined according to the Equals method. For example, the canonical declaration of the CONTAINS (Object O) method: "When and only if this collection contains at least one satisfying (o==null? E==null:o.equals (e)), returns True when element E. "This specification should not be understood as it implies that calling the Collection.contains method with a non-null parameter o causes the O.equals (e) method to be called
destroying users ' files and systems.Run phase: The computer executes this program byte by bit under the control of the CPU.First Program Common errorThe following error occurred:' Java ' is not an internal or external command, nor is it a running program or batch file. Set pathCompile Javac Test.java, clearly see the
How to use Jconsole to observe and analyze the operation of Java program, and to perform debugging and tuningBlog Category:
Java
JAVAORACLESUNECLIPSEJDK One, Jconsole is whatJConsole has been introduced from Java 5. JConsole is a built-in Java Performance Analyz
()); Output: [Object Object]Two "empty" objects are defined, and the ToString method is called to return the value, should not return undefined?Believe the Java program the ape smiled and guessed what had happened.Through Firefox debugging observation, two empty objects are really "empty". What's going on?Assuming that only the property is owned, and that two objects are indeed "empty", their prototype sho
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.