C++ Namespaces, comparison to Java packages

后端 未结 7 878
悲&欢浪女
悲&欢浪女 2021-01-31 08:07

I\'ve done a bunch of Java coding recently and have got used to very specific package naming systems, with deep nesting e.g. com.company.project.db. This works fine

7条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 08:24

    Java packages are not nested, they're flat. Any apparent nesting is nothing more than a naming convention.

    For example, the package com.company.project.db has no relation whatsoever to com.company.project or com.company.project.db.x. Code in com.company.project.db has no more access to code in com.company.project.db.x than would code in a.b.c.

提交回复
热议问题