Java Common pen Questions < four >

Source: Internet
Author: User

1, the following JSON format data, the error is:

A, {company:4399}

B, {"Company": {"name": [4399,4399,4399]}}

C, {[4399,4399,4399]}

D, {"Company": {[4399,4399,4399]}

E, {"Company": {"name": 4399}}

Reference Answer: AC

Analysis: The A:json object requires that the property must have double quotation marks; C:json must have a set of ordered key-value pairs. In addition, JSON can represent simple values (strings, numeric values, etc.), objects (a set of ordered key-value pairs, values for each set of key-value pairs can be simple data types or other), numeric values (a list of ordered values that can be accessed by a numeric index, the value of an array can be simple array type, object, or array)

2. The following statement about Java by value passing and referencing is wrong:

A, the value of the char type is passed by value

B, the pass of the array type is passed by reference

C, the user-defined type of delivery is passed by reference

D, the passing of a string type is passed by reference

Reference Answer: D

Analysis: Basic types and strings are passed by value in Java, and others are passed by reference. "Parameter Passing in Java is passed by value": Passing by value is a copy of the value passed, passing the address value of the reference by reference, so collectively referred to as value passing.

Java Common pen Questions < four >

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.