当前位置:网站首页>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
边栏推荐
- Numpy——1.數組的創建
- Simple operation with independent keys (hey, a little fancy) (keil5)
- Pit record of Chmod 2 options in deepin
- Close of office 365 reading
- Don't confuse the use difference between series / and / *
- golang定时器使用踩的坑:定时器每天执行一次
- 公安基础知识--fb
- UE5热更新-远端服务器自动下载和版本检测(SimpleHotUpdate)
- What is deep learning?
- Rough notes of C language (1)
猜你喜欢
I 用c I 实现队列
Ue5 hot update - remote server automatic download and version detection (simplehotupdate)
611. 有效三角形的个数
How to delete the virus of inserting USB flash disk copy of shortcut to
Self summary of college life - freshman
Using GEE plug-in in QGIS
【idea】Could not autowire. No beans of xxx type found
What is Bezier curve? How to draw third-order Bezier curve with canvas?
Build your own random wallpaper API for free
Pagoda create multiple sites with one server
随机推荐
Altimeter data knowledge point 2
Qu'est - ce que l'hydroxyde de sodium?
DataGrid offline installation of database driver
[untitled]
Simple operation of nixie tube (keil5)
Charles- unable to grab bags and surf the Internet
SQL JOINS
UE5热更新-远端服务器自动下载和版本检测(SimpleHotUpdate)
Mouse click fireworks explosion effect
With the help of Navicat for MySQL software, the data of a database table in different or the same database link is copied to another database table
玩转gRPC—深入概念与原理
UNIX commands often used in work
并查集理论讲解和代码实现
Pagoda create multiple sites with one server
NSIS search folder
R language learning notes 1
What if the DataGrid cannot see the table after connecting to the database
Clickhouse database installation deployment and remote IP access
What is sodium hydroxide?
[idea] common shortcut keys