Question: > 
> **Possible Duplicate:**  
> 
> [Can’t convert value type array to params object[]](https://stackoverflow.com/questions/9104268/cant-convert-value-type-array-to-params-object) 
> 
> 
> 

Why is 

```
object h = new byte();

```

possible and 

```
object[] h = new byte[5];

```

is not?

How to cast a byte Array to an object Array?

Thank You!

Answer: 
The first example boxes a *single value*.

In the second example, you're trying to convert a whole array. That just doesn't work. Each element of an `object` array is an `object` variable. Each element of a `byte` array is a `byte` variable. They don't share a representation - you just can't do it.

You can create a *new* object array from a byte array easily enough, e.g.

```
object[] objects = bytes.Cast<object>().ToArray();

```

... but you can't treat the byte array as if it *were* an object array.

Alternatively, you *can* use the `System.Array` type, which is compatible with `byte[]`. Does that help you?

```
byte[] bytes = ...;
Array array = bytes;

```
When you try to cast the arrays in your code, the cast fails because you are casting an array that holds type byte to an array which holds type object; the types which the array holds are not the same. When you cast a value type to type object, you are boxing (unboxing converts objects to value types). `object h = new byte();` is boxing. When you make the cast in your array code, that is not boxing, which is why it fails.