Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: how to get interface value from other module/compoent in Spring project in eclipse

  1. #1
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default how to get interface value from other module/compoent in Spring project in eclipse

    i have a interface class and find that my Spring project so many other class has implement that interface class.
    when i create a new get object in the interface and i want only 1 other class which implement with that interface class.
    after that i want to set the value and get the value in other module/compoent in java eclispe.

    why the class is passing the implementation class as parameter when getting value from interface like below coding..

    public inferface logonsession {

    public String getlogonMehtod(){
    }
    }


    public class personalLogonsession implement logonsession {

    logonsession getlogonsession = (longonsession) new logonsession();

    String StrLgoonMehtod= getlogonsession(logonsession.class).getlogonMethod ()

    }

    why the getlogonsession(logonsession.class).getlogonMethod () need to passing .class "logonsession.class" in parameter?

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how to get interface value from other module/compoent in Spring project in eclipse

    Please edit your post and wrap your code with code tags:

    [code]
    **YOUR CODE GOES HERE**
    [/code]

    to get highlighting and preserve formatting.

    Note: Having a variable name the same as a method name is confusing: getlogonsession

    Where is the declaration for the getlogonsession method? What arguments does it require?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Member
    Join Date
    May 2020
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: how to get interface value from other module/compoent in Spring project in eclipse

    Quote Originally Posted by Norm View Post
    Please edit your post and wrap your code with code tags:

    [code]
    public inferface logonsession {

    public String getlogonMehtod(){
    }
    }


    public class personalLogonsession implement logonsession {

    logonsession getlogonsession = (longonsession) new logonsession();

    String StrLgoonMehtod= getlogonsession(logonsession.class).getlogonMethod ()

    }
    [/code]

    to get highlighting and preserve formatting.

    Note: Having a variable name the same as a method name is confusing: getlogonsession

    Where is the declaration for the getlogonsession method? What arguments does it require?

    logonsession getlogonsession = (longonsession) new logonsession();

    String StrLgoonMehtod= getlogonsession(logonsession.class).getlogonMethod ()
    public inferface logonsession {
     
    public String getlogonMehtod(){
    }
    }
     
     
    public class personalLogonsession implement logonsession {
     private String _logonmethod;
     
    public void setLogonmehtod(Sting strLognMethod){
        _logonmethod=strLognMethod;
     
    }
     
    public String getLogonmethod(){
    return _logonmethod;
    }
     
     
    }
     
    public abstract class ...{
    logonsession getlogonsession = (longonsession) new logonsession();
     
    String StrLgoonMehtod= getlogonsession(logonsession.class).getLogonmethod()
     
    }

    Where is the declaration for the getlogonsession method? What arguments does it require?

    logonsession getlogonsession = (longonsession) new logonsession();

    String StrLgoonMehtod= getlogonsession(logonsession.class).getLogonmethod ()

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: how to get interface value from other module/compoent in Spring project in eclipse

    Can you answer this question?
    Where is the declaration for the getlogonsession method? What arguments does it require?
    Where is that method defined? Is it in your code or in another package from somewhere else?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Help please create Timer(TimerTasK) for Spring Boot and Vaadin 14 project
    By annabanner in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 24th, 2019, 06:42 AM
  2. My first Spring-MVC project
    By kjaron in forum Web Frameworks
    Replies: 0
    Last Post: October 3rd, 2019, 07:09 AM
  3. Replies: 1
    Last Post: April 6th, 2014, 05:16 PM
  4. Get Paid Spring project
    By mr.miku in forum Paid Java Projects
    Replies: 1
    Last Post: November 16th, 2011, 09:43 AM