当前位置:网站首页>Day09 how to create packages import package naming conventions Alibaba Development Manual
Day09 how to create packages import package naming conventions Alibaba Development Manual
2022-07-05 07:37:00 【33 year old Java enthusiast】
Packet mechanism
In order to better organize the class ,java Provide package mechanism , Namespace used to distinguish class names
After all, in the same file , The same name cannot be repeated in the same file
package pkg1[.pkg2[.pkg3]]
Introduction package import
import pkg1.dir.pkg2.*
Naming of package mechanism
Generally, the company domain name is used as the package name in reverse order
for example :www.baidu.com
Package name :com.baidu.www
idea Environment , Need some gear Tree App It's cancelled compact Middle Packages
Construction package
package com.ckw.blog.base;
// This is the address of the bag , Delete package You're going to report a mistake
// Write to the top
public class demo01 {
public static void main(String[] args) {
System.out.println(" This is the first one idea The program ");
}
}
Import package
import
package com.ckw.blog.base;
import com.ckw.blog.base.demo01;
// Import demo01
import com.ckw.blog.base.*;
// Import base All objects in
// This is the address of the bag , Delete package You're going to report a mistake
public class demo01 {
public static void main(String[] args) {
System.out.println(" This is the first one idea The program ");
}
}
Extracurricular
Baidu search Alibaba java Development Manual .
Understand the code specification
边栏推荐
猜你喜欢
Set theory of Discrete Mathematics (I)
The mutual realization of C L stack and queue in I
HDU1232 畅通工程(并查集)
Close of office 365 reading
Detailed explanation of miracast Technology (I): Wi Fi display
Openxlsx field reading problem
CADD course learning (6) -- obtain the existing virtual compound library (drugbank, zinc)
Oracle-触发器和程序包
Clickhouse database installation deployment and remote IP access
HDU1231 最大连续子序列(分治or动规or双指针)
随机推荐
Self summary of college life - freshman
Apple input method optimization
Differences between pycharm and idle and process -- join() in vs Code
What is deep learning?
Detailed explanation of miracast Technology (I): Wi Fi display
Ggplot2 drawing learning notes in R
Using GEE plug-in in QGIS
[untitled]
NPM and package common commands
Shadowless cloud desktop - online computer
Rough notes of C language (2) -- constants
Basic series of SHEL script (I) variables
Database SQL practice 4. Find the last of employees in all assigned departments_ Name and first_ name
CADD课程学习(5)-- 构建靶点已知的化合结构(ChemDraw)
Oracle code use
Microservice registry Nacos introduction
(tool use) how to make the system automatically match and associate to database fields by importing MySQL from idea and writing SQL statements
repo. conda. An example of COM path error
I can't stand the common annotations of idea anymore
【idea】Could not autowire. No beans of xxx type found