thursday'snotes
this site the web

Perbedaan abstract classs dan concrete class adalah….

Abstract Class Concrete Class
Tidak dapat menginstantiasi obyek Dapat menginstantiasi obyek
Harus memiliki minimal 1 abstract method Tidak boleh memiliki abstract method
Menggunakan keyword abstract Menggunakan keyword : dan merupakan turunan dari abstract class
Method abstractnya tidak memiliki body Methodnya berisi implementasi dari method class induknya

Contoh Abstract Class:

public abstract class Test
{
public abstract void Test ( );
}

public class testProgram : Test
{
Public abstract void Test( )
{
Console.Writeln(“Ini adalah test program”);
}
}

public class cetakTest
{
public static void Main ()
{
testProgram tes1 = new testProgram( );
}
}

0 comments:

Post a Comment

 

Disclaimer

I do not claim any of these images as my own unless otherwise stated

The views and opinions expressed on this blog are 100% mine. If I claim or appear to be an expert on a certain topic or product or service area, I will only endorse products or services that I believe, based on my expertise, are worthy of such endorsement. Any product claim, statistic, quote or other representation about a product or service should be verified with the manufacturer or provide

About Thursday's Notes

This blog is a personal blog written and edited by me, and does not reflect the views of either employers and/or clients. This blog does not accept any form of cash advertising, sponsorship, or paid topic insertions.