title: How can we create our own data type in java?
body: <p>I have a requirement where I have to create my own data type and i should assign some bytes to the data types.<br>
  Example:    </p>
  
  <p>Datatype A : should have 1 byte of memory<br>
  Datatype B : should have 2 bytes of memory<br>
  Datatype C : should have 7 bytes of memeory etc..</p>
  
  <p>Is there any way we can define our own data types and allocate some memory to them ?</p>