<!DOCTYPE html>
<html>
<head>
<link rel='stylesheet' href='style.css'/>
<script src='script.js'></script>
</head>
<body>
<script>
//Instantiate the Class
var varClass = new clsMyClasse();
document.write("--- Call the Public Attribute");
document.write("<br>");
document.write(varClass.atrAtributoPublico);
document.write("<br>");
document.write("--- Call the Public Method (Returns the Private Attribute through the Private Method)");
document.write("<br>");
document.write(varClass.mtdMetodoPublico());
document.write("<br><br>");
//Instantiate the Method inside Class
document.write("<br>");
var varJohn = new varClass.mtdPerson("John", "Smith", 30);
document.write("--- Call the Public Attribute instantiated in Public Method");
document.write("<br>");
document.write(varJohn.atrFirstName);
document.write("<br>");
document.write("--- Call the Public Attribute instantiated in Public Method");
document.write("<br>");
document.write(varJohn.atrLastName);
document.write("<br>");
document.write("--- Call the Public Attribute instantiated in Public Method");
document.write("<br>");
document.write(varJohn.atrAge);
document.write("<br><br>");
document.write("--- Accesses the Method inside another Method instantiated ");
document.write("(Receives the value returned by the Method)");
document.write("<br>");
var varMtdmyBalance = varJohn.mtdGetBalance();
document.write(varMtdmyBalance);
document.write("<br>");
</script>
</body>
</html>
|