Hyphenated company name in Java packages

后端 未结 5 1589
一生所求
一生所求 2020-12-09 01:54

Say you\'re working on the core module of the foo project for BarBaz Incorporated. Your code fragment might look like this:

package com.barbaz.f         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 02:15

    The SUN-era Java Language Specification gives a suggested convention:

    If the domain name contains a hyphen, or any other special character not allowed in an identifier (§3.8), convert it into an underscore.

    But it's just a suggestion...

提交回复
热议问题