There are two ways to access method in class.
public int methodtwo(int a, int b)
int sum = a+ b;
return sum;
}
public static void main(String[] args) {
configReader md = new configReader(); //Object Creation
int result = md.methodtwo(2,3); // access method by using object
System.out.println(result);
}
}
public static int methodone(int a, int b) {
return sum;
}
public static void main(String[] args) {
int resultone = methodone(3,4); //accessing method directly without object
}
*************************************************
API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign
Java Related Interview Question Set
https://automationreinvented.blogspot.com/search/label/Java
GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT
Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions
No comments:
Post a Comment