Pre Test

Welcome to your Pre Test

Wrapping up of data and methods together as one unit is termed as:

The datatype which is specified that the method does not retum a value is:

The logical operator which is an unary operator:

Math.pow(625, 1/2 ) + Math.sqrt(144)

Multiple branching statement of java is

How many times the inner loop is executed?

for(k=1 ; k<=2;k++)

{ for(m=1:m<=4;m++)

{ System.out.println(m*2);


int res='A', What is the value of res?

The output of Double.parseDouble("71.25")+0.75 is:

Name the type of error that occures for the following statement:



Evalute the expression:

Z+=a++ + --b - ++a+ --b


Write java expression for:

|x^2 + xy|

Rewrite the following using ternary operators:


Write a program to input electricity unit charges and calculate total electricity bill according to the given condition:

  • For first 50 units Rs. 0.50/unit
  • For next 150 units Rs. 0.75/unit
  • For next 250 units Rs. 1.20/unit
  • For unit above 250 Rs. 1.50/unit
  • An additional surcharge of 20% is added to the bill

Write a C program to input an alphabet and check whether it is vowel or consonant using switch case.

WAP in java to draw Downward Triangle Pattern


WAP in java to enter a number and check whether the number is Special two digit number or not.

A special two-digit number is a number such that when the sum of the digits of the number is added to the product of its digits, the result is equal to the original two-digit number. 

Examples : 

input : 59. output : 59 is a Special Two-Digit Number Explanation: Sum of digits = 5 + 9 = 14 Product of its digits = 5 x 9 = 45 Sum of the sum of digits and product of digits = 14 + 45 = 59