i have in part of my program error "Use of unassigned local variable".

long gg = weight << 7;(error 15)

it means that 'weight' hasn't been given a value yet; try putting '=0' in the declaration.

Simple i am considering weight as integer type.Because you didn't mention it here.
So type :

int weight=new int();

It will call its constructor, and assign its default value which is 0