Select Page

Java QUiz

Welcome to your Java Test

Name
E mail
1.What is Inheritance? Give example also.(2 marks)
2.Write sample code to show method overloading and method overriding. Explain the difference between the two.(4 marks)
3.What are the different types of access specifiers? Explain the difference between them.(4 marks)
4.Write the output of below program (2 marks):

class Test  



    public static void main (String args[])   { 


        System.out.println(10 + 20 + "Indeed");  


        System.out.println("Prushal" + 10 + 20); 


    } 


5.What is constructor? (2 marks)
6.Write the output of below program (2 marks):

class Test  



    int _a, _b; 


    Test(int a, int b)  


    { 


    _a = a;  


    _b = b;  


    } 


    public static void main (String args[])    { 


        Test test = new Test();  


        System.out.println(test._a+" "+test._b); 


    } 


7.What is the difference between static (class) method and instance method? Give example. (4 marks)
8.What are the differences between this and super keyword? (2 marks)
9.Write the output of below program (2 marks):

class Person  



    public Person()   { 


        System.out.println("Person class constructor called"); 


    } 



public class Employee extends Person  



    public Employee()   { 


        System.out.println("Employee class constructor called"); 


    } 


    public static void main (String args[])  { 


        Employee e = new Employee(); 


    } 


10.What is difference between list and vector? (4 marks)
11.Write a Java program to find the minimum value in a given array. (4 marks)

Selenium Test

Welcome to your selenium Test

Name
E mail
Que 1 - Which one of below is not the locators in Selenium?
Que 2 - Syntax to print get the text in Selenium -
Que 3 - Write the code for taking the screenshot in Selenium-
Que 4 - Explain the difference between single and double slash in X-path?
Que 5 - What is the difference between verify and assert commands?
Que 6 - What are the annotations used in TestNG?
Que 7 - What are the different types of waits in Selenium?
Que 8 - Explain about the ImplicitWait & ExplicitWait!
Que 9 - What is the difference between static & dynamic waits?
Que 10 - Perform a test to login on Amazon site and then print the MRP and SP(Price after discount of below product in console. Please validate the MRP of 799.

Quiz-Python miscellaneous

Welcome to your Python miscellaneous Quiz

Name
E mail
1.What is the output of the following program :
print "Hello World"[::-1]
2.Given a function that does not return any value, what value is shown when executed at the shell?
3.Which module in Python supports regular expressions?
4.What is the output of the following program :
print 0.1 + 0.2 == 0.3
5.Which of the following is not a complex number?
6.What does ~~~~~~5 evaluate to?
7.Given a string s = “Welcome”, which of the following code is incorrect?
8.________ is a simple but incomplete version of a function.
9.To start Python from the command prompt, use the command ______
10.Which of the following is correct about Python?

Quiz-Python Output Type

Welcome to your Python output type Quiz

Name
E mail
1.What is the output of the following program :


def myfunc(a):
      a=a+2
            a=a*2
      return a
print myfunc(2)

2.What is the output of the expression : 3*1**3
3.What is the output of the following program :


print'{0:.2}' . format (1.0 / 3 )

4.What is the output of the following program :
print '{0:-2%}'.format(1.0 / 3)
5.What is the output of the following program :
i = 0
while i < 3:
       print i
       i += 1
else:
      print 0
6.What is the output of the following program :
i = 0
while i < 5:
     print(i)
     i += 1
     if i == 3:
              break
else:
     print(0)
7.What is the output of the following program :
print 'cd'.partition('cd')
8.What is the output of the following program :
print 'abef'.partition('cd')
9.What is the output of the following program :
print 'abcefd'.replace('cd', '12')
10.What will be displayed by the following code?
def f(value, values):  
          v = 1
          values[0] = 44
t = 3
v = [1, 2, 3]
f(t, v)
print(t, v[0])

Quiz-Python operators

Welcome to your Python Operators Quiz

Name
E mail
What is the output of the following code ?
9//2
Which function overloads the >> operator?
Which operator is overloaded by the or() function?
What is the output of the following program :

i=0
while i<3:
          print i
          i++
          print i+1