Analysis of the error problem in Java OOP exam

Source: Internet
Author: User

Analytical:a.arraylist can store null values, or they can store duplicate values, without any effect on the collection. B. Once the instantiation does not change its size, this is the attribute of the array. The capacity of a collection is self-expanding. C.arraylist can store duplicate values and have no effect on the collectionD.arraylist No capacity This attribute, translated is the meaning of capacity, ArrayList capacity will automatically expand without giving value, the default value is ten.parsing:A. Compilation is not an error, the Write method has two parameters, one is an int is a byte array, and char can be considered to be an integer that is smaller than the int range All compilation does not go wrongB. Open the impossible with NotepadC. The code does not have an exception with text open write is aD. Writing only one char type cannot be garbledparsing:the three main systems of the Java Collection class are: Map Set Listiterator is an interface, and it's just an iterator. parsing:Listiterator is the addition of an element to the list collection through the Add () method.parsing:add elements to the ArrayList collection with a For loop, there is no error in the code, but the Java virtual machine gives the [], all B is correctparsing:set is an interface to the list at the same level, and there is no inheritance relationship between the two. parsing:The elements in the HashMap collection are unordered.parsing:HashMap is non-thread safe (unsynchronized), allows the key value to be null, and Hashtable is not allowed, Hashtable is thread safe (synchronous), all hashmap are more efficientparsing:log4j Output level: Fatal>error>warn>info>debugparsing:a method or field specific to a subclass cannot be called with a parent class object.  

Analysis of the error problem in Java OOP exam

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.