Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:40:40+00:00 2026-06-04T11:40:40+00:00

Login.java PortalHandler portalHandler = new PortalHandler(dataString); … public PortalHandler getPortalHandler(){ return portalHandler; } PortalHandler.java

  • 0

Login.java

PortalHandler portalHandler = new PortalHandler(dataString);
...
public PortalHandler getPortalHandler(){
        return portalHandler;
    }

PortalHandler.java

public String getName()
{
return name;
}

ThirdClass.java I want to get to get the name in that instance created by login.java but following gives an null pointer error

Login login;
PortalHandler portalHandler = login.getPortalHandler();

How can it be done?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:40:44+00:00Added an answer on June 4, 2026 at 11:40 am

    You need to initialize login like so: Login login = new Login().

    That’s assuming of course that Login has a constructor that takes no arguments.


    Edit in response to OP’s comment

    I think you’re looking to do something like this:

    Login login = new Login();
    login.doLoginStuff();
    PortalHandler portalHandler = login.getPortalHandler();
    // Do nothing with login from here on out
    

    You can then do whatever you need to do with portalHandler and forget about login. But you have to initialize login with new Login() (or one of Login‘s constructors) before you can use it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to make this code work? LogonControl.java @Audit(AuditType.LOGON) public void login(String
How can I get the username/login name in Java? This is the code I
//----AppActivity.java public class AppActivity extends Activity { Button Login; @Override public void onCreate(Bundle savedInstanceState)
I have created a form to login and password in java swing. I want
I want to allow users to sign up and login to my Java web
I am creating a login form for my java app. But I can't get
I'm using GSSAPI in Java in order to login to an LDAP server using
I have tried several ways to login to a website through java. I have
I'd like to secure my (Java metro) webservice with a login. Here's how I'm
I need to make a java program with a security and a login system

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.