Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "package com.api does not exist".
- import com.api.APIUser;
- public class Test{
- APIUser ap = new APIUser();
- ap .login();
- public static void main(String[] args){
- //to do
- }
- }
- package com.api
- public class APIUser{
- public string login(){
- //to do
- return string;
- }
- }
- import com.api.APIUser;
- public class Test {
- // APIUser ap = new APIUser(); // This call should be in the method body,
- // there is no use to keep it at the class level
- // ap.login(); // This call should be in method body
- public static void main(String[] args) {
- // TO DO
- APIUser ap = new APIUser();
- ap.login();
- }
- }
- package com.api; // added termination here
- public class APIUser {
- //access specifier should be public
- public string login(){
- //to do
- //return string;//return some value from here, since string is not present this will lead to error
- return "string";
- }
- }
Add Comment
Please, Sign In to add comment