wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SDET

Total questions: 166

Worksheet time: 1hrs 23mins

Name
Class
Date
1.
Consider the below XPath and select the correct meaning //li[@id='lastItem']//following::a
a)
Find all the anchor tags and a list item whose id is 'lastItem'
b)
Find a list item whose id is 'lastItem' and falls after an anchor tag
c)
Find all the anchor tags in the entire DOM which are falling after the list item whose id is 'lastItem'
d)
None of the above
2.
Consider the below XPath and select the correct meaning //li[@id='firstItem']//child::*
a)
Find all the child nodes (with any tags) of the list item whose id is 'firstItem
b)
Find a list item whose id is 'firstItem' and falls after an anchor tag
c)
Find all the anchor tags in the entire DOM which are falling after the list item whose id is 'firstItem'
d)
None of the above
3.
Which component of Selenium can create customized test results
a)
WebDriver
b)
Selenium IDE
c)
Selenium Grid
d)
Selenium RC
4.
The test suites are organized and run using the ____ file.
a)
Testng.html
b)
Testng.xml
c)
Testng.php
d)
Testng.pl
5.
Which of the following is an example of a Cucumber data table?
a)
A table of test results
b)
A table of test requirements
c)
A table of input parameters
d)
A table of test scenarios
6.
1.What is/are the characteristic(s) of BDD?
a)
a)Strong Collaboration
b)
b)High Visibility
c)
c)Lower Costs
d)
d)All of the above
7.
2.Which of the following ways can be used to add TestNG in your Eclipse?
a)
a)TestNG can be installed either by adding the TestNG jar file to the Build Path or by installing the TestNG plug-in.
b)
b)The TestNG plug-in is preferable to the testng.jar file since you don't have to install it for every project. Testng.jar files, on the other hand, must be added to every project's build path.
c)
c)Both A and B
d)
d)None of the above mentioned
8.
3. ---------- are those software mistakes that occurred during the coding phase?
a)
a)Defects
b)
b)Failures
c)
c)Errors
d)
d)Bugs
9.
4.Action class is defined and invoked using the following syntax:
a)
a)Actions action = new Actions(driver); action.moveToElement(element).click().perform();
b)
b)Actions actions = new Action(driver);
c)
c)Actions action = new Actions(driver); action.moveToElement(element).click;
d)
a)Actions actions = new Action(driver); actions.moveToElement(element).click.perform;
10.
5.Given the below statement, select the correct method chaining for performing the right-click operation? Actions a=new Actions(driver);
a)
a).contextClick().perform();
b)
b).contextClick().build();
c)
c).contextClick();
d)
a).context.perform().click();
11.
Select the command which is used to print a string valueor a variable in Selenium IDE.
a)
The 'display' command
b)
The 'echo' command
c)
The 'print' command
d)
The 'printf' command
12.
What is the best time to perform Regression testing?
a)
1. After the software has been modified
b)
2. As frequently as possible
c)
3. When the environment has been modified
d)
4. Both option a & c
13.
Which is not the right approach of Incremental testing approach?
a)
1. Big bang approach
b)
2. Top-down approach
c)
3. Functional incrimination
d)
4. Bottom-up approach
14.
After all test methods in a suite have been executed, the @____ annotation will run.
a)
1 AfterSuite
b)
2 AfterClass
c)
3 AfterMethod
d)
4 AfterTest
15.
Which of the following is a Cucumber option that can be used to generate reports in different formats?
a)
1. –tags
b)
2. –strict
c)
3. –name
d)
4. –format
16.
Check whether the given statement is true or false? 'Selenium web driver does not require server installation, test scripts interact directly with the browser.'
a)
Yes
b)
No
17.
Which of the following method allows you to change control from one window to other?
a)
SwapTo ()
b)
SwitchTo ()
c)
Swap ()
d)
Switch ()
18.
A method with '@BeforeTest' annotation in a class will execute _______
a)
Before every test method in the class
b)
Once before the execution of test methods in the class begins
c)
After every test method in the class
d)
None of the above
19.
If @Test annotation is put at class level then ______ ?
a)
All the public methods of the class become test methods and only public methods will execute as test methods.
b)
All the methods including public, private, protected, become test methods and all will execute as test methods.
c)
TestNG run time exception will be thrown
d)
TestNG Notations
20.
Which of the following is an example of a Cucumber tag expression?
a)
1. @smoke
b)
2. @smoke or @regression
c)
3. @smoke and @regression
d)
4. All of the above
21.
Which of the following is not the alternative to selenium?
a)
Cucumber
b)
Cypress
c)
Mocha
d)
Puppeteer
22.
Does selenium support ASP.NET language?
a)
Yes
b)
No
23.
Test methods are executed in multiple threads based on the configuration in the ____ file.
a)
HTML
b)
CSS
c)
XML
d)
C
24.
C#, Java, Perl, PHP, Python, Ruby, and Perl are some of the languages supported by Selenium.
a)
C#
b)
Java
c)
Perl
d)
All of the above
25.
Identify the term which is not related to testing?
a)
Failure
b)
TestCase
c)
TestBot
d)
Error
26.
To notify the developer which bugs need to be fixed first is termed as?
a)
A) Scalability
b)
B)Flexibility
c)
C)Tracebility
d)
D)Priority
27.
Which is not the right approach of Incremental testing approach?
a)
A)Big bang approach
b)
B)Top-down approach
c)
C)Functional incrimination
d)
D)Bottom-up approach
28.
Which of the following method is used to work with multiple browser windows?
a)
A)getMultipleWindows()
b)
B)getWindowHandles()
c)
C)getWindowhandle()
d)
D)Both B &C
29.
Unlike Junit, TestNG does not have constraints like ____.
a)
A)@beforeclass
b)
B)@afterclass
c)
C)Both A and B
d)
D)None of the above
30.
Which of the following is an example of a Gherkin keyword?
a)
A)Test
b)
B) Given
c)
C)Verify
d)
D) Assert
31.
The method used to close an alert in selenium
a)
1.build().perform()
b)
2.build.perform()
c)
3.build().Perform()
d)
4.None of the above
32.
The method used to close an alert
a)
1.alert().quit();
b)
2.alert().dismiss();
c)
3.alert().close();
d)
4.alert.quit();
33.
The method used to open a website in a selenium webdriver
a)
1.driver.set(url);
b)
2.driver().get(url);
c)
3.driver().set(url);
d)
4.driver.get(url);
34.
How can we get a text of a web element?
a)
1.String Text = driver.findElements(By.id("Text")).getText();
b)
2.String Text = driver.findElement(By.id("Text")).getText();
c)
3.String Text = driver.findElement(By#id(Text)).getText();
d)
4.string Text = driver.findElement(By.id("Text")).setText();
35.
In which programming language Cucumber was written?
a)
1.python
b)
2.C#
c)
3.Ruby
d)
4.Java
36.
Which of the following is a name of the Black-Box Testing?
a)
1.Code Based Testing
b)
2.Glass Box Testing
c)
3.Specification based Testing
d)
4.Structural testing
37.
_____cases may have to be modified depending on the changes made in the functionality(e.g. new field added to a screen)
a)
1.Defect
b)
2.Regression Testing
c)
3.Performance Testing
d)
4.Stress test
38.
Navigate to https://www.softwaretestinghelp.com Navigate back. Navigate forward.
a)
1.driver.navigate().to("https://www.softwaretestinghelp.com"); driver.navigate().to.back(); driver.navigate().to.forward();
b)
2.driver.get("https://www.softwaretestinghelp.com"); driver.navigate().back(); driver.navigate().forward();
c)
3.driver.navigate().to("https://www.softwaretestinghelp.com"); driver.navigate().back(); driver.navigate().forward();
d)
4.driver.navigate().to(“https://www.softwaretestinghelp.com"); driver.toRefresh(); driver.navigate().back(); driver.navigate().forward();
39.
The test suites are organized and run using the ____ file.
a)
1.Testng.html
b)
2.Testng.xml
c)
3.Testng.php
d)
4.Testng.pl
40.
Which of the following option is used to select the value from dropdown?
a)
1. selectByVisibleText()
b)
2.selectByValue()
c)
3.Both a and b
d)
4.none of the above
41.
The method used to check whether the dropdown allows multiple selection?
a)
1.isMultiple()
b)
2.ismultiple()
c)
3.Both a and b
d)
4.There is no method to select multiple option
42.
In order to skip the test,which special symbol can be used within the tag?
a)
1.~
b)
2./
c)
3.\
d)
4.!
43.
Which method is used to give timeout in junit?
a)
1. @Test(timeout=1000)
b)
2. @Timeout(time=1000)
c)
3. @Test(Timeout=1000)
d)
4.none of the above
44.
Deviation from a specific or expected behaviour,this is called?
a)
1. An error
b)
2.A failure
c)
3. A defect
d)
4. A fault
45.
Testing where in we subject the target of the test , to varying workloads to measure and evaluate the performance behaviors and ability of the target and of the test to continue to function properly under these different workloads.
a)
System Testing
b)
Load Testing
c)
Integration Testing
d)
Usability Testing
46.
1.package testNG; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class test2 { public static void mail(String[] args){ @BeforeTest public void beforetest() { System.out.println("before test"); } } }
a)
Excecution error
b)
ouput:beforetest
c)
no error
d)
Run time error
47.
How many components does selenium IDE has?
a)
9
b)
15
c)
7
d)
4
48.
package page_synchronization; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; public class Wait_Statements { public static void main(String[] args) System.setProperty("webdriver.chrome.driver","/Users/SU20463226/Downloads/chromedriver_mac64/chromedriver"); WebDriver driver = new ChromeDriver(); WebDriverWait wait = new WebDriverWait(driver, 10); driver.get("https://demo.opencart.com/"); driver.manage().window().maximize(); wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.name("search")))); driver.findElement(By.name("search")).sendKeys("phone"); } }
a)
Exectuion error
b)
opens chrome successfully
c)
no console output
d)
Runtime Error
49.
Which exception is shown in selenium when there is a delay in the loading time of the elements with which we are interacting?
a)
A)Not Visible Exception
b)
B)Element Not Visible Exception
c)
C)Load Time Exceeding Exception
50.
Unlike Junit, TestNG does not have constraints like ____.
a)
A)@beforeclass
b)
B)@afterclass
c)
C)Both A and B
d)
D)None of the above
51.
Which of the following actions is a part of the Jira workflow?
a)
A)Edit
b)
B)Modify
c)
C)Work in Progress
d)
D) None of the above
52.
What is/are the basic term(s) of Cucumber?
a)
A)Feature File
b)
B)Features
c)
C)Tags
d)
D)All of the above
53.
If you want to validate that a button has appeared on a page, which two commands would be the best two to use?
a)
A) verifyTextPresent/assertTextPresent
b)
B)verifyElementPresent/assertElementPresent
c)
C) verifyAlertPresent/assertAlertPresent
d)
D)verifyAlert/assertAlert
54.
contextClick() method of the Actions class performs __________ operation?
a)
A)Double click
b)
None of the above
c)
C)click and hold
d)
d)Mouse over
55.
____-based files are used to configure TestNG test suites.
a)
HTML
b)
CSS
c)
XML
d)
PHP
56.
Which component of Selenium can create customized test results
a)
Selenium WebDriver
b)
Selenium RC
c)
Selenium IDE
d)
Selenium Grid
57.
Select the command which is used to print a string valueor a variable in Selenium IDE.
a)
reference
b)
log
c)
echo
d)
display
58.
The Switch is switched off once the temperature falls below 18 and then it is turned on when the temperature is more than 21. Identify the Equivalence values which belong to the same class.
a)
14,15,19
b)
22,23,24
c)
24,27,17
d)
12,16,22
59.
What is Gherkin?
a)
A programming language
b)
A type of vegetable
c)
A tool for behavior-driven development (BDD)
d)
A database management system
60.
Unlike Junit, TestNG does not have constraints like ____. @beforeclass @afterclass Both A and B None of the above
a)
beforeclass
b)
afterclass
c)
both A and B
d)
None of the above
61.
Which type of selenium command use testers to verify the state of the application?
a)
Actions
b)
Assertions
c)
Assesors
d)
Access Modifiers
62.
Which component of selenium is the most important component?
a)
Selenium RC
b)
Selenium IDE
c)
Selenium WebDriver
d)
Selenium Grid
63.
*---------- are those software mistakes that occurred during the coding phase?
a)
bugs
b)
errors
c)
failures
d)
defects
64.
What is the purpose of Cucumber?
a)
To write tests in a human-readable format
b)
To automate software testing
c)
To improve software quality
d)
All of the above
65.
Which selenium component is also known as selenium 1
a)
Selenium (IDE)
b)
Selenium Remote Control
c)
WebDriver
d)
Selenium Grid.
66.
A more powerful and easier-to-use framework, TestNG framework came ____ JUnit.
a)
Before
b)
After
c)
Alongwith
d)
None
67.
Which of the following is an advantage of using Cucumber for testing
a)
Tests are written in a human-readable format
b)
Tests can be easily automated
c)
Tests can be written by non-technical stakeholders
d)
All of the above
68.
Which of the following is end result of Software Requirement Analysis
a)
Usability and Reliability
b)
Architectural and Structural
c)
Functional and Behavioral
d)
Algorithmic and Data Structure
69.
Your software or mobile app can be tracked with Jira, a ___ tracking tool.
a)
Bug
b)
Data
c)
Software
d)
None
70.
What will be the script to click on the link with the text "click here" in the given HTML structure <a href="www.myworld.com" src="abc" >Click here</a>
a)
driver.findElement(By.partialLinkText("Click")).click();
b)
driver.findElement(By.partialLink("Click")).click();
c)
driver.findElement(By.Link("Click")).click();
d)
driver.findElement(By.CSS("Click")).click();
71.
Given the below statement, select the correct method chaining for performing the right-click operation? Actions a=new Actions(driver);
a)
a.contextClick();
b)
a.contextClick().build();
c)
a.contextClick().perform();
d)
a.contextClick().Click();
72.
Annotations like @____, or @BeforeClass are examples of Before and After annotations.
a)
BeforeSuite
b)
BeforeTest
c)
BeforeGroups
d)
All of the above
73.
Which of the following is TRUE about Jira?
a)
It is a very effective tool for managing defects.
b)
Defects/issues are tracked and managed using it.
c)
Provides a lifecycle process for issues and defects.
d)
All of the above
74.
Alpha testing is done at
a)
Developer’s end
b)
User’s end
c)
Developer’s & User’s end
d)
None of the mentioned
75.
There is a feature keyword at the beginning of every Cucumber testing feature file.
a)
Feature
b)
Scenario
c)
Then
d)
When
76.
How do you maximize a web page?
a)
driver.manage().window().maximize();
b)
driver.manage().maximize();
c)
driver.manage().enlarge
d)
driver.manage().window().enlarge();
77.
What would be the exception thrown by the WebDriver if the web page is refreshed after the element was located?
a)
NoSuchElementException
b)
ElementNotVisibleException
c)
Both (A) and (B)
d)
StaleElementReferenceException
78.
Which of the following comes first in the hierarchy of TestNG Annotations?
a)
BeforeSuite
b)
BeforeClass
c)
BeforeTest
d)
BeforeMethod
79.
Given the below statement, select the correct method chaining for performing the right-click operation? Actions a=new Actions(driver);
a)
contextClick().perform();
b)
contextClick().build();
c)
contextClick();
80.
What is TRUE about Agile?
a)
An agile approach to software development is a philosophy based on values and principles.
b)
Iterative-incremental methodologies are at the core of agile development.
c)
Both A and B
d)
None of the above
81.
Which of the following is a Cucumber option that can be used to specify the path to the feature files?
a)
–tags
b)
–strict
c)
–format
d)
–glue
82.
End result of Software Requirement Analysis is ________.
a)
Functional and Behavioral
b)
Architectural and Structural
c)
Usability and Reliability
d)
Algorithmic and Data Structure
83.
________ calls the function and passes it test data.
a)
Test Stub
b)
Test Driver
c)
Proxy
d)
None of the above
84.
Consider the below XPath and select the correct meaning //li[@id='firstItem']//child::*
a)
Find all the child nodes (with any tags) of the list item whose id is 'firstItem
b)
Find all the anchor tags in the entire DOM which are falling after the list item whose id is 'firstItem'
c)
Find a list item whose id is 'firstItem' and falls after an anchor tag
d)
None of the above
85.
What will be the script to click on the link with the text "click here" in the given HTML structure <a href="www.myworld.com" src="abc" >Click here</a>
a)
driver.findElement(By.partialLinkText("Click")).click();
b)
driver.findElement(By.partialLink("Click")).click();
c)
driver.findElement(By.Link("Click")).click();
d)
None of the above
86.
A more powerful and easier-to-use framework, TestNG framework came ____ JUnit.
a)
Before
b)
After
c)
Alongwith
d)
None
87.
Which of the following is an example of a Gherkin keyword?
a)
Given
b)
test
c)
Verify
d)
Assert
88.
Identify the fault-based testing technique.
a)
Beta Testing
b)
unit testing
c)
mutation testing
d)
stress testing
89.
When can white-box testing be started?
a)
After SRS creation
b)
After Installation
c)
After Programming
d)
After Designing
90.
White box testing is also known as?
a)
Behavioral Testing
b)
Glass box testing
c)
Structural testing
d)
None of the above
91.
A testng.xml file defines_, and test groups that are used to create test suites?
a)
Classes
b)
Methods
c)
Packages
d)
All of the above
92.
Selenium method to get content which is inside any HTML tags?
a)
getText()
b)
getValue()
c)
get()
d)
getAttribute()
93.
Which of the following method is used to work with multiple browser windows?
a)
getMultipleWindows()
b)
getWindowHandles()
c)
getWindowhandle()
d)
Both 2 & 3
94.
contextClick() method of the Actions class performs __________ operation?
a)
Double Click
b)
Right click
c)
Click and hold
d)
None of the above
95.
Given the below statement, select the correct method chaining for performing the right-click operation?
a)
a.contextClick().perform();
b)
a.contextClick().build();
c)
a.contextClick();
d)
a.click();
96.
Which of the following is a popular testing framework used with Selenium?
a)
TestNg
b)
Cucumber
c)
Junit
d)
All of the above
97.
Which of the following is non-functional testing?
a)
Black box testing
b)
Performance testing
c)
Unit testing
d)
None of the mentioned
98.
Which of the following is black box testing
a)
Basic path testing
b)
Code path analysis
c)
Boundary value analysis
d)
None of the mentioned
99.
Which one is a class in Selenium?
a)
A) WebDriver
b)
B) WebDriverWait
c)
C) WebElement
d)
D) getPageSource
100.
In Selenium, Following Axis is related to:
a)
A) Selects all the siblings after the current element
b)
B) Selects all of the siblings before the current element
c)
C) Selects all elements that follow the closing tab of the current elements.
d)
D)Selects all elements that are before the current element
101.
In the case of Selenium IDE, the Source view shows your script in:
a)
A) XML format
b)
B) HTML format
c)
C) DHTML format
d)
D) J2EE format
102.
What is/are the basic term(s) of Cucumber?
a)
A)Feature File
b)
B)Features
c)
C)Tags
d)
D)All of the above
103.
Which of the following is not a part of test plan?
a)
A) Scope
b)
B) Mission
c)
C)Objective
d)
D)Risk
104.
Which is used to check defects in software application without executing the code
a)
Dynamic Testing
b)
Sanity Testing
c)
Static Testing
d)
Regression testing
105.
What is Gherkin?
a)
A programming language
b)
A tool for behavior-driven development (BDD)
c)
A database management system
d)
Project Management Tool
106.
The word JIRA comes from
a)
Australian
b)
Japanese
c)
English
d)
Arabic
107.
Which method returns Dimension
a)
getText()
b)
getAttribute()
c)
getSize()
d)
getLocation()
108.
5.How many Test tags are included in testng.xml
a)
Only one
b)
Two
c)
Three
d)
None of the above
109.
In web driver, what is the method that counts the number of elements?
a)
driver.getCountOfElements()
b)
Driver.findElement(By.id("search")).getCount()
c)
Driver.findElements(By.id("search")).length()
d)
Driver.findElements(By.id("search")).size()
110.
Which of the following is true in case of waitFor command?
a)
waitForAlertPresent
b)
waitForTextPresent
c)
waitForFramePresent
d)
waitForPageToLoad
111.
Which of the following is true about the selenium ide?
a)
It is a web-based testing tool.
b)
It supports multiple programming languages.
c)
It requires installation of additional libraries.
d)
It can automate only Firefox browser.
112.
Agile frameworks like ____ allow you to plan, iterate and continue a project.
a)
Scrum
b)
Sprint
c)
Scrum Master
d)
Scrum development team
113.
As projects go through the workflows, they are entered into a ____ database using JIRA.
a)
Central
b)
Decentral
c)
Rational
d)
Irrational
114.
1.Consider the below Xpath and select the correct meaning //li[@id='firstItem']//child::*
a)
A) Find all the chiled nodes(with any tags)of the list item whose id is 'firstItem'
b)
B)Find a list item whose id is 'firstitem' and falls after an anchor tag
c)
C)Find all the anchor tags in the entire DOM which are falling after the list item whose id is 'firstItem'
d)
D)None of the above
115.
2.In cucumber,comments will be denoted with
a)
A) !
b)
B) @
c)
C) $
d)
D) #
116.
3.You can run a single or multiple test cases in your TestNg.xml file using e.g: @Test(priority=1)
a)
A)TRUE
b)
B)FALSE
117.
5.Which JUnit annotation is used to ignore a test method?
a)
A)@Ignore
b)
B)@Skip
c)
C)@Disable
d)
D)Exclude
118.
Which of the following is not a wait command in Selenium?
a)
waitForActive
b)
waitForAlert
c)
waitForTitle
d)
None of these
119.
Which of the following categories, Black-box testing attempts to find errors?
a)
Incorrect or missing functions
b)
Interface errors
c)
Behavior or performance errors
d)
All of the above
120.
In the TestNG framework, test cases can be defined ____ one another.
a)
Dependently of
b)
Independently of
c)
Interdependently of
d)
Intradependently of
121.
Why we are using JIRA?
a)
To improve QA process
b)
To improve development process
c)
To make a centralized location to store project details
d)
All of above
122.
How many files required to execute a Cucumber test scenario?
a)
1
b)
2
c)
3
d)
4
123.
Which method can be defined only once in a program?
a)
Main Method
b)
Finalize Method
c)
Static Method
d)
Private Method
124.
What is the use of main method in java?
a)
it can used more than once in program
b)
its the exit point of the program
c)
its the entry point for executing a Java program.
125.
Which option is false about the final keyword?
a)
A final method cannot be overridden in its subclasses.
b)
A final class cannot be extended.
c)
A final class cannot extend other classes.
d)
A final method can be inherited.
126.
ArrayList list = new ArrayList();   What is the initial quantity of the ArrayList list?
a)
5
b)
10
c)
100
127.
int values[ ] = {1,2,3,4,5,6,7,8,9,10}; for(int i=0;i< Y; ++i) System.out.println(values[i]); Find the value of value[i]?
a)
10
b)
11
c)
15
d)
None of the above
128.
Find the output of the following program. public class Solution{ public static void main(String[] args){ short x = 10; x = x * 5; System.out.print(x);} }
a)
50
b)
10
c)
Compile Error
d)
Exception
129.
Predict the output Map<String,Integer>=orderMap=new TreeMap<>(); ordermap.put("Dress",50); orderMap.put("Shoes",10); orderMap.put("Belt",60); System.out.println(ordermap)
a)
[Dress=50,Belt=60,shoes=10]
b)
[Belt=60,Dress=50,shoes=10]
c)
[shoes=10Belt=60,Dress=50]
d)
compile error
130.
Public class Demo { public static void mani(String[] args){ try{ throw new ArrayIndexoutofBound Exceptions(); }catch(RuntimeException re{ System.out.println("Hi"); }catch(ArrayindexOutofBoundException ai{ System.out.println("Hello"); } } }
a)
compile time error at 1st catch block
b)
compile time error at 2nd catch block
c)
Hi Hello
d)
Hello
131.
predict the output public class student{ int id; String name; student(String m,int a) { this.name=n; this.name=a
a)
[Mike=100,john=200]
b)
{Mike=100,john=200};
c)
prints hashcode of the objects added in ArrayList a1
d)
compile time error at line 2 and line 3
132.
class array_output { public static void main(String args[]) { int array_variable[][] = {{ 1, 2, 3}, { 4 , 5, 6}, { 7, 8, 9}}; int sum = 0; for (int i = 0; i < 3; ++i) for (int j = 0; j < 3 ; ++j) sum = sum + array_variable[i][j]; System.out.print(sum / 5); } }
a)
9
b)
10
c)
11
d)
8
133.
class array_output { public static void main(String args[]) { int array_variable [] = new int[10]; for (int i = 0; i < 10; ++i) { array_variable[i] = i; System.out.print(array_variable[i] + " "); i++; } } }
a)
1 3 5 7 9
b)
0 1 2 3 4 5 6 7 8 9
c)
1 2 3 4 5 6 7 8 9 10
d)
0 2 4 6 8
134.
final class A { int i; } class B extends A { int j; System.out.println(j + " " + i); } class inheritance { public static void main(String args[]) { B obj = new B(); obj.display(); } }
a)
3 3
b)
Run Error
c)
Compile Error
d)
2 2
135.
import java.util.*; class Arraylists { public static void main(String args[]) { ArrayLists obj = new ArrayLists(); obj.add("A"); obj.add("B"); obj.add("C"); obj.add(1, "D"); System.out.println(obj); } }
a)
[A,B,C]
b)
[A,B,C,D]
c)
[A,D,B,C]
d)
[A,D,C]
136.
Public class Test{ Public static void main(String argos[]){ String str1 = “one”; String str2 = “two”; System.out.println(str1.concat(str2)); } }
a)
two
b)
onetwo
c)
twoone
d)
one
137.
predict the output public Static void main(String[] args) { float f=2.0f; //line1 double d=4.0; //line2 System.out.println(d*f); }
a)
8
b)
Compile time error at line 1
c)
Compile time error at line 2
d)
None of the above
138.
public class Main { public static void main(String[] args) { Map<String, Integer> t=new LinkedHashMap<>(); t.put("Car",10); t.put("Apple",5); t.put("Bat",20); System.out.println(t); } }
a)
{Car=10, Apple=5, Bat=20}
b)
{'Apple'=5,'Bat'=20, 'Car'=10}
c)
{'Car'=10, 'Apple'=5, 'Bat'=20}
d)
{Apple=5, Bat=20,Car=10}
139.
public static void main(String[] args) { double a, b,c; a = 3.0/0; System.out.println(a); }
a)
NaN
b)
Infinity
c)
All of the above
140.
public static void main(String[] args) { double a, b,c; a = 3.0/0; System.out.println(a); }
a)
1 2 3 4 5
b)
1 2 3 4
c)
1 2
d)
1 2 3
141.
Which of these are selection statements in Java?
a)
break
b)
continue
c)
for()
d)
if()
142.
Class Dogs{ public String toString() {return “theDogs”; } } public class TestDogs{ public static void main(String[] args){ Dogs[][] dogs=new Dogs[3][]; System.out.println(dogs[2][0].toString()); } } What is the result?
a)
null
b)
theDogs
c)
Complilation Fails
d)
NullPointerException is thrown at runtime
143.
Which of these array declarations and initialization are legal
a)
int arr[4] = new int[4];
b)
int[4] arr = new int[4];
c)
int arr[] = new int[4];
d)
int[] arr = new int[4];
144.
public static void main(String args[]) { int a=Integer.parseInt("four"); } }
a)
IllegalStateException
b)
NumberFormatException
c)
ClassCastException
d)
ArrayIndexOutOfBoundsException
145.
Which of the below line will give compilation error? interface Test{ int p=10;//line 1 public int q=20;//line 2 public static int r=30;//line 3 public static final int s=40;//line 4 }
a)
2
b)
3
c)
4
d)
None of the above
146.
What is the output of the program? class Box { int width; int height; int length; } class Result { public static void main(String args[]) { box obj = new box(); obj.width = 10; obj.height = 2; obj.length = 10; int y = obj.width * obj.height * obj.length; System.out.print(y); } }
a)
100
b)
200
c)
300
d)
400
147.
Which keyword in java is used for exception handling?
a)
Scanner
b)
excepted
c)
throw
d)
All of these
148.
Which of the following can be declared as final in java?
a)
Class
b)
Method
c)
Variable
d)
All of the above
149.
Which class in Java is used to take input from the user?
a)
Scanner
b)
Input
c)
Applier
d)
None of the above
150.
A method which is declared as abstract and does not have implementation is known as an _____________?
a)
Abstract Interface
b)
Abstract Thread
c)
Abstract List
d)
Abstract Method
151.
public class Test{ public static void main(String args[]) { int x=3,y=4; switch(x+3) { case 6:y=0; case 7:y=1; default:y+=1; } } }
a)
1
b)
2
c)
3
152.
which of the following are devops tools?
a)
git
b)
jenkins
c)
sonarq
d)
All of the above
153.
Full form of devops
a)
Development and operations
b)
Developing operations
c)
Develop and operate
d)
Development and operating
154.
The command is used to fetch and download content from a remote repository and immediately update the local repository to match that content.
a)
git pull
b)
git push
c)
git commit
d)
git add
155.
which of the following is distributed version control system?
a)
git
b)
jenkins
c)
sonarq
d)
postman
156.
what is the use of jenkins?
a)
continuos integration &continuos deliverable
b)
continuos integration &continuos distribution
c)
continuos interaction &continuos deliverable
d)
continuos implementation&&continuos distribution
157.
The devops tool used to test the quality of build
a)
jenkins
b)
sonarq
c)
git
d)
All of the above
158.
What are the key components of DevOps?
a)
Continuous Testing
b)
Continuous Integration
c)
Continuous Delivery & Monitoring
d)
All of the above
159.
Which of the following is not a part of DevOps lifecycle ______.
a)
Operating
b)
Plan
c)
Build
d)
Code
160.
What is the use of Git?
a)
Containerization tool
b)
Continuous Integration tool
c)
Version Control System tool
d)
Continuous Monitoring tool
161.
DevOps is an extension of_______
a)
QA
b)
Agile
c)
Waterfall
d)
None of the above
162.
Which one of the following statements about DevOps is incorrect?
a)
DevOps is only suitable for start-up companies
b)
DevOps is suitable for brownfield software products and services
c)
DevOps is suitable for greenfield software products and services
d)
Some of the most exemplary DevOps initiatives started in companies with giant and mature IT organizations
163.
Which of the following is not a feature of continuous delivery?
a)
Gathering Requirement
b)
Automate Everything
c)
Continuous Improvement
d)
Bug fixes and experiments
164.
What are the useful plugins in Jenkin?
a)
Maven 2 Project
b)
Amazon EC2-
c)
HTML Publisher
d)
All of the above
165.
Which command fetches and merges changes on the remote server to your working directory.
a)
Git pull
b)
git push
c)
git init
d)
git log
166.
Which of the following command is initialise a directory?
a)
git init
b)
git add
c)
git commit
d)
git status