05-Class-Inheritance.html


Dosyayı İndir
<html>
<head>
	<script>
		class Person{
			constructor(firstName,lastName){
				this.firstName=firstName;
				this.lastName=lastName;
			}
			
			getFullName(){
				return this.firstName+" "+this.lastName;
			}
			toString(){
				return this.getFullName();
			}
	
		}
		
		class Customer extends Person{
			constructor(customerId,firstName,lastName,totalDebit){
				super(firstName,lastName);
				this.customerId=customerId;
				this.totalDebit=totalDebit;
			}
		
			toString(){
				return this.customerId+"-"+super.toString();
			}
			
		}
		
		var customer=new Customer(301,"Orhan","Gencebay",2300);
		console.log("Alıcı: "+customer.getFullName()+" Borç: "+customer.totalDebit);
		
		console.log("Sicim: "+customer);
	</script>
</head>
<body>
	<h1> Kalıtım </h1>
</body>
</html>

				
Dosyayı İndir

Bu Sayfayı Paylaş:




Bu Sayfayı Paylaş:

İletişim Bilgileri

Takip Et

Her Hakkı Saklıdır. Bu sitede yayınlanan tüm bilgi ve fikirlerin kullanımından fibiler.com sorumlu değildir. Bu sitede üretilmiş , derlenmiş içerikleri, fibiler.com'u kaynak göstermek koşuluyla kendi sitenizde kullanılabilirsiniz. Ancak telif hakkı olan içeriklerin hakları sahiplerine aittir