Results 1 to 4 of 4
  1. #1
    chyrl is offline Senior Member
    Join Date
    Mar 2010
    Location
    Manila, Philippines
    Posts
    257
    Rep Power
    5

    Exclamation Java OOP help...

    Greetings,

    I am wondering on how these statement is illustrated.
    Java Code:
    ClassInterface data = (ClassInterface)ClassExtended.staticMethod();
    How is ClassExtended connected to ClassInterface? Is it inherited or extended?

    Thanks,
    Cyril H.
    Every project, package, class, method, variable, syntax, algorithm, etc.
    are registered in my memory bank. Thanks to this thread.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default

    Who knows, without the code for those classes and/or interfaces?

    Recommended reading: How To Ask Questions The Smart Way

    db

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,433
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by chyrl View Post
    Greetings,

    I am wondering on how these statement is illustrated.
    Java Code:
    ClassInterface data = (ClassInterface)ClassExtended.staticMethod();
    How is ClassExtended connected to ClassInterface? Is it inherited or extended?
    All we can say, given your small code snippet and nothing else, is that ClassExtended contains a method named staticMethod() and it returns (*) an object of type ClassInterface. Only you know how ClassExtended is related to ClassInterface. I consider this a very vague question.

    kind regards,

    Jos

    (*) it should return such object or else the cast fails.
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    Join Date
    Dec 2010
    Posts
    22
    Rep Power
    0

    Default

    None. Please make your question more specific to get a more specific answer

Posting Permissions

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