Java19: Object array

Source: Internet
Author: User

Object array:

The element of the object is not a primitive type, but a reference type



Two-dimensional arrays of Java (essentially no two-dimensional arrays)

It's pseudo.

is array arrays


Package Day19;public class Demo1 {public static void main (string[] args) {int[][] ary = {{1,2,3},{4,5},{6,7,8}        };    System.out.println (Ary[0][0]); }}


Abstract classes Express Abstract concepts

Cannot create object directly (Cannot create object using new)

He represents the abstract concept of logic.

Abstract classes can protect abstract methods, using the method of abstract declarations

Creating an abstract class using abstract class animal{}

Abstract classes can define variables (attributes) to define methods, referencing instances of specific subclasses (objects)

Abstract methods cannot have method bodies, defined in abstract classes

Abstract classes can only be inherited, and all abstract methods must be implemented in a specific subclass (overriding abstract methods)







Java source file structure

There can be multiple classes in a Java file, but there can be only one public class, and the file name is consistent with the public class

If there is no public class, the file name is consistent with a class name

Public classes can be visible in any location and can be accessed across packages, other classes in the file are default access adornments and can only be visible within the current package


In general: A public class in a source file


Keywords appear in order:

The package is usually in the first line

Import

Imports import java.lang.* by default;

Class



This article is from the "Romantic Laugh" blog, make sure to keep this source http://lmdtx.blog.51cto.com/6942028/1730084

Java19: Object array

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.