Exforsys
+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Abstract classes

This is a discussion on Abstract classes within the Java forums, part of the Programming Talk category; ya, we can call the concrete methods by class name as jazzsona said if that method is declared as static ...

  1. #11
    JITENDRAKUMAR is offline Junior Member Array
    Join Date
    Oct 2010
    Answers
    1
    ya, we can call the concrete methods by class name as jazzsona said if that method is declared as static even without object.

    Thanks


  2. #12
    davidwillson is offline Junior Member Array
    Join Date
    Oct 2010
    Answers
    1
    Quote Originally Posted by sujeet.varshney View Post
    abstract classes can't be instantiated must be overridden by the derived classes to use and reimplement their methods
    "yes,ssprastogi is right.we can do it.thanx i was not knowing it"


  3. #13
    nikole95 is offline Junior Member Array
    Join Date
    Jan 2011
    Answers
    1
    Quote Originally Posted by Bijay29 View Post
    We cannt create an object of an Abstract class..
    abstract classes can't be instantiated must be overridden by the derived classes to use and reimplement their methods


  4. #14
    Nagaraj is offline Junior Member Array
    Join Date
    Feb 2011
    Location
    Bangalore
    Answers
    3
    Yes we can call concrete method of a abstract class without inheriting but method should be declared as static. If its not declared as static then abstract class should be extended by derived class, then u can call concrete method.
    For Example:

    abstract class display
    {
    static void display()
    {
    System.out.println("Calling Concreate method");
    }
    }

    public class AbstractMethodCalling {

    public static void main(String args[])
    {
    display.display();
    }

    }

    OUTPUT:

    Calling Concreate method


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...