add demo for method and array