I need to create java class which has 2 methods:

public class IPTPLogin extends IPTPCommand {
	
	/** The email address */
	private String login;
	/** The password of email */
	private String passcode;
	
	/** Creates a new instance of IPTPLogin */
	public IPTPLogin(String log, pass) {
		setLogin(log, pass);
	}
	
	/** Set the login */
    protected void setLogin(String log) {
        login = new String(log);
    }
	
	/** Set the Passcode */
    protected void setPasscode(String pass) {
        passcode = new String(pass);
    }
	
	/** Get the sender address */
    public String getLogin() {
        return login;
    }
	
	/** Get the Passcode */
    public String getPasscode() {
        return passcode;
    }
	
 }

So, that I could create object of class

IPTPLogin c = (IPTPLogin)command;

And, use methods of the class:

c.getLogin(), c.getPasscode()

I guess what you need is a controller class that has a main method inside it. then, in your main method, you instantiate an instance of your IPTPlogin class, and invoke the two methods just as you wrote above.

I can't give you the code, but here is a guideline.

class name as expected in java
    declaration of main method as expected in java
           instantiation of IPTPlogin object
                invocation of first method
                invocation of second method
    mark the end of main method
mark the end of class
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.