As to the person who has been brought up on With ++, me very much does not suffice in Java typedef. Whether there are any normal methods to receive similar functionality in Java? I want to receive semantic integrity of the data types. At me in the project the set of the data is transferred as String or int. But as a matter of fact there absolutely different data types are transferred. For example, at objects is Id, InstanceId, ResourceId and so forth, transferred as String and by mistake developers can sometimes take Id and transfer it there where it is expected ResourceId. Syntactically problems are not present - both there and there a line, but logically it is an error. And to trace this error occasionally difficult. I would like to receive any from the compiler in such places. In With ++ I would make it through typedef, but in Java such feature is not present. Those for types which can be declared through using, it at all that, it works only within the limits of one file. Other decision occurring - to be inherited from standard types, something like it: public class InstanceIdType extends String But it is impossible so to make, for class String is declared as "final", closed for inheritance. While on mind creation of the classes-wrappers having an internal field of type String or int comes, but it leads to creation of a heap of additional small objects in . It would not be desirable to sacrifice productivity and storage. Can eat any other methods? Any magic summaries prompting when String it is possible to transfer in a method expecting String and when it is impossible? The Development environment - Intellij IDEA, but in an ideal the general-purpose decision that everywhere worked since some developers use Eclipse would be necessary.