Results 1 to 2 of 2

Thread: abstract

  1. #1
    Himanshu23 is offline Member
    Join Date
    Nov 2010
    Posts
    9
    Rep Power
    0

  2. #2
    magesh5 is offline Member
    Join Date
    Oct 2010
    Posts
    3
    Rep Power
    0

    Default

    Here see sample example for abstract.
    // A Simple demonstration of abstract.
    abstract class A {
    abstract void callme();
    // concrete methods are still allowed in abstract classes
    void callmetoo() {
    System.out.println("This is a concrete method.");
    }
    }

    class B extends A {
    void callme() {
    System.out.println("B's implementation of callme.");
    }
    }

    class AbstractDemo {
    public static void main(String args[]) {
    B b = new B();
    b.callme();
    b.callmetoo();
    }
    }

    vist this site you wil get idea about abstract class & method..

    Code Style: Java abstract classes frequently asked questions (FAQ)

Similar Threads

  1. Replies: 3
    Last Post: 08-13-2010, 04:57 AM
  2. Replies: 3
    Last Post: 09-16-2009, 09:27 PM
  3. Replies: 6
    Last Post: 02-11-2009, 10:51 AM
  4. Replies: 2
    Last Post: 11-21-2008, 12:20 AM
  5. Replies: 6
    Last Post: 10-27-2008, 12:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •