JAVA Written test notes

Source: Internet
Author: User
Tags float double

1.java Advantages and Disadvantages: pure face object, cross-platform, provide many built-in class library, support web development, have good robustness and security shortcomings: slow, cross-platform can not be as close to the operating system as other languages, complex 2.java and C + + are facing the object language. Java is an explanatory language (a compilation is used permanently), C is a compiled language, Java does not have pointers, does not support multiple inheritance, does not require developers to allocate memory, Java cross-platform 3.public static void main (String "" args) is the entry function for Java, but it is not the first to run the function. 4.java scope has global variables, local variables public all classes and objects can access protected the same package and subclass can access private only you can access the default Only the same package can be accessed in 5. A Java file can have more than one class, but only a public-decorated class 6. Constructors, like the class name, are called together in new, and the initialization of the class can be multiple, can have no arguments, cannot inherit and overwrite, can be overloaded, and super can call 7. Hold multiple inheritance, create a same class with an interface (set of abstract classes) 8.clone, without affecting the original Class 9. The reflection mechanism is that the Java language allows the program to self-check, and also allows internal members to be checked, to dynamically create objects of the class 10.package-- (1) solve the naming conflict problem (2) make the project more structured and readable 11. Implement pointer function through DLL (System dynamic link library) callback function 12. The object is to encapsulate the data and methods together, as an interdependent whole, the process is event-centric, step-through 13. Abstract Inherit package polymorphism 14. Face the advantages of object development: high efficiency and robustness, good maintainability 15. Inheritance (the subclass invokes the parent class's member variables and methods) combination (The new class creates an object of the original class, reuses the existing functionality) 16. Overloading (Same-name method, different parameter) and overwrite (in subclass, with same parameter) -polymorphic 17. Abstract class and interface same point: neither can instantiate a different point only if an interface or abstract class is implemented: An interface can only be defined and cannot be implemented, and an abstraction may be defined with a member variable that implements an interface definition that defaults to public static final18. Get the class name of the parent class GetClass (). GetName () 19.this point to the current instance object super can access Fred method or member variable 20. Identifiers can only have characters, numbers, underscores, and $, and cannot start with a number 21.breake out of the current loop continue Stop the current loop return methodThat enables the program to return Java Runtime system 22.final declared properties immutable method non-overridden class cannot be inherited finally is a function of the garbage collection mechanism called the Recycle object after the Trycatch is executed finalize is a method of 23.assert software debugging, Code correctness check mechanism 24.static defines a variable that is a method of a global variable defined only if the object is created, only one 25 can be executed once with the code block. Switch (expr) expr can be a byte short char int26.volatile modifier variable put into the buffer, improve code efficiency, variable value change cache value unchanged 27.instanceof Check whether the object is a class 28.STRICTFP Precision arithmetic floating point 29. Basic data type Byte int short long double char Boolean float30. Immutable class, once created cannot be modified 31. Value is passed by value, and reference delivery is pass-through address 32. Data type conversion low to Dayne conversion byte " Short "char" int "long" float double high to low strong conversion 33.round rounding ceil up to take the whole floor down to take the whole 34.i++ first assigned value after the operation + + I first operation after the assignment of 35.char stored in a Chinese with two characters, English only with one 36. String creation is new and is a different address of 37. " = = "Compare address equals compare straight hashcode (no rewrite Hashcode method will never be the same) 38.String immutable class, once created immutable StringBuffer mutable class, secure Stringbilder mutable class, unsafe, The encounter is a character buffer stringtokenizer is a tool class for string splitting 39. Array is object, int[] a=new int[] int[] a={1,2}; int[] A a=new int[]{1,2}40.length take number leader Length () takes a string length of 41. Check for exceptions exception can avoid 42.InputStream and outputstream characters in the code Reader and writer are in bytes (no cache is used) 43java Sockets are used to implement communication between virtual machines or different computers 44. Non-blocking IO (NIO) is a non-blocking IO operation via selector channel and buffer 45.java serialization means that when communicating, the state of the object is written in the stream for networkTransfer or save files ... 46. Explain the three steps of execution: code loading Code checksum code execution 47. GC is a garbage collection mechanism 48. Memory leaks: Objects that are no longer used take up memory for a long time and do not get a release solution: Implement the Equals and Hascode methods of the key class. 49. Heap: Holds the stack of objects created at runtime: the base type and the reference variable 50. Collections class containing a large collection of interfaces "list (save in order) set (element non-repeatable) map (save key-value pairs ()" List (LinkedList bidirectional list ArrayList vector synchronized with different steps) Map (HashMap, unsafe weakmap identityhahmap) *key non-repeatable collection is a collection interface 51. Iterators to facilitate and select objects in a sequence

JAVA Written test note

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.