Java Fundamentals 2

Source: Internet
Author: User
Tags java reference

1. Java What are the basic data types in? How many bytes each? What are the reference data types in Java? What encoding does the char type use in basic data Java?

byte byte 1 byte, short shorter integer 2 byte, int integer 4 byte, long length integer 8 bytes, float single precision 4 byte, double double type 8 byte, char character type 2 Byte, Boolean Boolean 1 byte;

Java Reference type: class, array, interface;

Java basic data type, which holds the address of the object that the data, Java reference type holds;

The char type is Unicode encoded;

2. What are the three elements of a variable?

Variable name, data type, variable value

3. Java How many comments are there?

Single-line comment,/* */Multiline Comment,/** */Document comment (can generate help document with Javadoc)

4. What are the keywords for defining constants?

Final

5. What is an object? What is a class? What are the relationships between objects and classes?

An object is a concrete entity that has definite characteristics and behavior, and is the result of encapsulation of data;

Class: Is a set of objects that have the same properties and behaviors;

A class is an abstraction of an object that is an instance of a class;

Java Fundamentals 2

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.