28. Write a Java application as required:(1) Define a class that describes a rectangle that contains two properties of length and width, and calculates the area method.(2) Write a class, inherit from the rectangle class, and the class describes the
0. Download Jdk8Login URL: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.htmlSelect the corresponding JDK version to download. (Can be shared to Linux via folder after download is completed under Windows)1. Log in to
OverviewFor programmers in C and C + +, in memory management, they are both the people who have the highest rights and the "working men" who are engaged in the most basic work.For Java programmers, the JVM automates memory management, and
1. Introduction of object-oriented thinkingWhen there are multiple arrays that need to be traversed, we can encapsulate the traversed code into a method, and call the appropriate method to improve the reusability of the code when it needs to be
HashSet: Storing strings and traversingQuestion: Why does the string content store only one when the string is stored?By looking at the source of the Add method, we know that this method relies on two methods: Hashcode () and Equals ().Steps:First,
Used to keep track of what's going on in actual programming and keep updating.Such as:Develop a coordinate calculation tool, a for moving to the left, D for moving to the right, W for moving up, and s for moving down. Moves from the (0,0) point,
1. Properties class and properties configuration fileThe properties class inherits from the Hashtable class and implements the map interface, and it also holds the property set in the form of a key-value pair. However, the properties have a special
Defining Classes Humanhas several properties and functions, and defines its subclass man,Woman;in the main class in test, create subclasses, parent classes, and up-to-transform objects, and test their attributes. Human:Package eryi; Public
Static import:Format: Import static package name .... class name. method name;Levels that can be imported directly to a methodConsiderations for static Import:A: The method must be staticB: If you have more than one static method with the same name,
These days the project has been finished, has been idle, write code entertainment, by the way to learn backstageJava several definitions① object: An object is an instance of a class that has state and behavior. For example, a dog is an object whose
Say something first.These days, when nothing happens, think of something, go to find some information to see, to supplement learning, things that were always forgotten, or new to hear things. This time, just record the concept that has been easy to
1.final classThe final class cannot be inherited, there are no subclasses, and the methods in the final class are final by default.The final class cannot be inherited, so the member methods of the final class have no chance of being overwritten, and
(1) PrimaryLet's start with a few simple usage scenarios: Rename properties, ignore properties, and modify the type used by the property.Note: The following example shows only the member properties (field properties), and annotations can also be
Problem?I have a collection, such as the next, I would like to determine if there is no "world" this element, if any, I will add a "Java ee" element, please write code implementation.Interview questions:Concurrentmodificationexception: This
Iterators (Iterator)An iterator is a design pattern that is an object that can traverse and select objects in a sequence, and the developer does not need to know the underlying structure of the sequence. Iterators are often referred to as
1.thisThis is an implicit parameter, which is the constructed object, and we access the instance domain in the same way as this.Public Employee (String name,double salary){This.name=name;This.salary=salary;}Here's a brief look at the difference
Turn from: Milk, unsweetened http://www.cnblogs.com/ITtangtang/archive/2012/04/22/2465382.html1. Java.lang.NullPointerException (null pointer exception)An uninitialized object or an object that does not exist is calledOften appear in the Create
Generic Advanced (wildcard Character)?: any type, if not explicit, is object and any Java class.? Extends E: down qualification, E and its subclasses? Super E: limit up, E Extreme Parent class1 Importjava.util.ArrayList;2 Importjava.util.Collection;3
Reflection 1, the reflectivity of coal is 1.2 to 1.7Class (java. lang. Class)
Public final class extends Objectimplements Serializable, GenericDeclaration, Type, AnnotatedElementThree instantiation modes of Class objects
Class Object (Class)
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