HighDots Forums  

Re: JavaScript + Java

Javascript (Italian) Il linguaggio JavaScript (it.comp.lang.javascript)


Discuss Re: JavaScript + Java in the Javascript (Italian) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
APB
 
Posts: n/a

Default Re: JavaScript + Java - 09-12-2003 , 12:19 PM






Gli oggetti vengono creati come se fossero funzioni, tipo

function MyObject()
{
this.string_var="";
this.num_var1=0;
this.num_var2=0;
this.myMethod=somma;
}

L'ultimo comando crea un metodo e sostanzialmente "linka" una funzione specificata in precedenza.

Da qui in poi puoi crearti nuovi oggetti:

test1=new MyObject();
test1.num_var1=3;
test1.num_var2=5;
test1.string_var="la somma è" + test1.somma();
alert(test1.string_var);

Spero renda l'idea

Alex.
--
__________________________________________________ _________
a p bertolini

"Se Dio è perfetto, perché ha creato le funzioni discontinue?"

#ICQ: 10681264
(www.webwarrior.org)



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.