Hands on the brain 1Enumeration type Gu Weihua 2015/10/3Package test2;public class Enumtest {public static void Main (string[] args) {TODO auto-generated method stubsSize S=size.small;Converting from a string to an enumerationSize
The data types in Java are defined at the time of definition, so they cannot be arbitrarily converted to other data types. We can only do a certain amount of processing of the type conversion. There are two types of conversions: automatic type
@Override is pseudo-code, which means rewriting (and of course not writing), but the following benefits are written:1, can be used as a comment, easy to read;2, the compiler can give you to verify @override the following method name is all in your
1. The size of the nine basic data types, as well as their encapsulation class.2. Can switch use string to make arguments?Answer: Swith can use parameter types in the Java language: only convertible int values, strings or enum variables is
OverviewBefore explaining the methods in the thread class, the interrupt (), Interrupted (), and isinterrupted () Three methods did not speak very clearly, only to mention a bit. Now put these three methods in the same place, because these three
can only read 97-2003 of the file format xls, does not support xlsx formatimport java.io.file;import jxl.*;p ublic class excelutils { Public static void main (String[] args) { try { workbook book = workbook.getworkbook
There are three main features of Java object-oriented design: encapsulation, inheritance and polymorphisma package of 1.1 Concept: It is to hide some of the class's sensitive information in the class section of the class, not directly accessible to
1. Practice: Store 5 student objects in a collection and traverse the student objects.Analysis:(1) Create student class(2) Creating a Collection Object(3) Create student objects(4) Add students to the collection(5) Turn the set into a group(6)
Personally, the stream is the medium in which data is exchanged between different devices in Java, such as the transmission of data in the socket, and the read and write operations of the files, all of which are implemented through streams.Type of
Processes and ThreadsWhen it comes to multithreading, you have to first talk about the concepts of processes and threads.ProcessA process can be understood as a basic unit of operation managed by the operating system. 360 browser is a process, WPS
1. The difference value type of equals and = = in Java is a stack stored in memory (the stack), whereas a variable of a reference type is simply the address of the reference type variable stored in the stack, which itself is stored in the heap.2, = =
public class Enumtest {public static void Main (string[] args) { Size s=size.small; Size T=size.large; S and T refer to the same object? System.out.println (s==t);
ObjectiveDeadlocks write a separate article because it is a serious problem that must be brought to the attention of the individual. This is not an exaggeration of the risk of a deadlock, although the lock is usually held for a short time, the
Join threads The thread that executes the method, allowing the current county to execute another thread after executionPackage Org.famous.unyielding.current.jooin;public class Threadjoinclient {public static void main (string[] args) { Thread t =
Recursion: Oneself calls oneself, return returns, must have the end condition.The depth of recursion can not be too deep, or there will be a stack overflow, and do not do divergence recursionPackage Day13;public class Demo01 {public static void main
1. Classification of IO StreamsFlow:(1) Input stream: Read data to Memory(2) Output stream: Write data to Hard disk (disk)Data type of operation:(1) Byte stream: The manipulated data is bytesinput Stream the output stream(2) Character stream: The
What is parameter passing? In the C function or Java method, pass a parameter to a function or method, for example: void Fun (int num) {num+=2;} Inta= 3; Fun (a) ; This a is passed as a parameter into the function fun (), as a, and then returns or
1 Public classmain{2 3 /*Analog Deadlock4 * 5 * Persona to get B to give A to B6 * PERSONB's got A to give B to a .7 * 8 * 9 * Ten */ One A Public Static voidMain (string[] args) { - NewThread (NewRun (
Suppose that there is a class,classloader first load it into the memory of the code segment (memory stored in the snippet), standing in the angle of ClassLoader, the memory of a class is one of the objects, This object is Xx.class, which is actually
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