Class question

Whats the diference between

a=function(){ txt=“hello” }

test=new a()

trace(test.txt)

and this****************************

a=function(){}
a.prototype.txt=“hello”

test=new a()

trace(test.txt)

??? is not the same?