Tuesday 18 August 2020

Top 11 interview question on Java for SDET/Automation Testing/Experienced?











 
 
 
 
 
 
 
 
 
This is the first set of Java questions for SDET and Automation testing, will post more posts in following weeks so stay tuned and do subscribe for future posts.
 
                                        Automation Testing(java)-Set-05

41. What is Eager and Lazy Initialization of Singleton Class ?


42. What modifiers are accepted for Main class in Java?

Ans: public, abstract & final are permitted
 
43. Write code to reverse a string without using function?

Ans:
public class reverse {
    public static void main (String args[]) {
       
            String str = "automationreinvented";
            int n = str.length();
            String rev="";
            for (int i=n-1;i>=0;i--)
             rev = rev + str.charAt(i);
            System.out.println(rev);

          }
    }

44. How to do string manipulation in java?


45. Write a Java function which will return the maximum number in array?

Ans:
static int max()
    {
    int i;
    int max = findmaximum[0];
    for (i=1;i<findmaximum.length;i++)
   
        if (findmaximum[i] > max)
            max = findmaximum[i];
       
        return max;
    }

46. How to sort an Array using function?

Ans:
public class sortIntegerArray {
   
        public static void main(String[] args) {
            int[] arr={2,9,3,5,4,7,1,8,6};
            int temp;
            Arrays.sort(arr);
            for(int i=0;i<arr.length;i++)
            {
                System.out.println(arr[i]);
            }

        }
    }

47. How to Add/Join/Combine two arraylist?



48. How to convert List to array and array to list?

Ans: To convert List to Array:   list.toArray();
To convert Array to List:   Arrays.asList(Array);

49. How to get length of Array and List?

Length of array: array.length();
Size of list: list.size();

50. Difference between comparable and comparator in Java?

 
51. How to call a method in Java with and without object?
 

Want to learn more? ...Check below link for more java interview question:
 

*******************************************************************
For any doubts or career guidance, reach out to me 

****************************************

TOP 15 BDD - CUCUMBER Interview Q&A


************************************************

✍️AUTHORLinkedIn Profile

************************************************

Learn (API-Microservice)Testing+ Selenium UI Automation-SDET with Self Paced Videos prepared by FAANG employees and LIVE Doubt Session 

SDET TRANING VIDEOS AVAILABLE with Live Doubt Session(course-1 below,API TRaining Videos With Class Notes and Coding Set) and (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122. 
This includes classnotes, 300+ interview questions, 3 projects, Java Coding question set for product companies along with career guidance from FAANG employees for Automation and SDET.

For more details whatsapp : https://lnkd.in/dnBWDM33

*************************************************

SeleniumWebdriver Automation Testing Interview Questions:

https://automationreinvented.blogspot.com/search/label/SeleniumWebdriver

API Testing Interview Question Set:

https://automationreinvented.blogspot.com/2022/03/top-80-api-testing-interview-questions.html

DevOps Interview Q&A:

https://automationreinvented.blogspot.com/2021/11/top-11-devops-interview-questions-and.html 

Kubernetes Interview Question Set

https://automationreinvented.blogspot.com/search/label/Kubernetes

Docker Interview Question Set

https://automationreinvented.blogspot.com/Docker

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/2021/09/top-40-git-interview-questions-and.html

Coding Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Coding%20Questions

Mobile Testing Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Mobile%20Testing

Python Interview Question Set for QAE - SDET - SDE:

https://automationreinvented.blogspot.com/search/label/Python


 


 


No comments:

Post a Comment

All Time Popular Posts

Most Featured Post

API Status Codes with examples for QA-Testers

  🔺 LinkedIn: https://www.linkedin.com/in/sidharth-shukla-77b53145/ 🔺 Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl 🏮In API testing, it...