Please select a subject first
Advertisements
Advertisements
The access specifier that gives least accessibility is ______.
Concept: undefined >> undefined
What is the output of Math.ceil(5.4) + Math.ceil(4.5)?
Concept: undefined >> undefined
Advertisements
The extension of a Java source code file is ______.
Concept: undefined >> undefined
Which of the following data type cannot be used with switch case construct?
Concept: undefined >> undefined
Which of the following mathematical methods returns only an integer?
Concept: undefined >> undefined
Define a class to overload the method perform as follows:
| double perform (double r, double h) | to calculate and return the value of Curved surface area of cone CSA π rl `l = sqrt(r^2 + h^2)` |
| void perform (int r, int c) | Use NESTED FOR LOOP to generate the following format r = 4, c = 5 output - 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 |
| void perform (int m, int n, char ch) | to print the quotient of the division of m and n if ch is Q else print the remainder of the division of m and n if ch is R |
Concept: undefined >> undefined
"Java compiled code (byte code) can run on all operating systems" - Name the feature.
Concept: undefined >> undefined
Which of the following is not true with regards to a switch statement?
Concept: undefined >> undefined
Method prototype for the method compute which accepts two integer arguments and returns true/false.
Concept: undefined >> undefined
Assertion(A): An argument is a value that is passed to a method when it is called.
Reason(R): Variables which are declared in a method prototype to receive values are called actual parameters.
Concept: undefined >> undefined
Rewrite the following code using single if statement.
if(code=='g')
System.out.println("GREEN");
else if(code=='G')
System.out.println("GREEN");Concept: undefined >> undefined
A student executes the following program segment and gets an error. Identify the statement which has an error, correct the same to get the output as WIN.
boolean x=true;
switch(x)
{ case 1:System.out.println("WIN");break;
case 2;System.out.println("LOOSE");
}Concept: undefined >> undefined
Write the java expression for `root3x + sqrty`
Concept: undefined >> undefined
Define a class to accept a number and check whether it is a SUPERSPY number or not. A number is called SUPERSPY if the sum of the digits equals the number of the digits.
Example1:
Input: 1021
Output: SUPERSPY number [SUM OF THE DIGITS = 1+0+2+1 = 4, NUMBER OF DIGITS = 4]
Example2:
Input: 125
Output: Not an SUPERSPY number [1+2+5 is not equal to 3]
Concept: undefined >> undefined
Write a program to input integer elements into an array of size 20 and perform the following operations:
(i) Display largest number from the array.
(ii) Display smallest number’ from the array.
(iii) Display sum of all the elements of the array.
Concept: undefined >> undefined
Write the return data type of the following function:
endsWith( )
Concept: undefined >> undefined
Write two characteristics of a constructor.
Concept: undefined >> undefined
Write a program to initialize the seven Wonders of the World along with their locations in two different arrays. Search for the name of the country input by the user. If found, display the name of the country along with its Wonder, otherwise display “Sorry Not Found!”.
Seven wonders — CHICHEN ITZA, CHRIST THE REDEEMER, TAJMAHAL, GREAT WALL OF CHINA, MACHU PICCHU, PETRA, COLOSSEUM
Locations — MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN, ITALY
Example —
Country Name: INDIA Output: INDIA-TAJMAHAL
Country Name: USA Output: Sorry Not Found!
Concept: undefined >> undefined
Give the output of the following string methods.
"MISSISSIPPI".indexOf('S') + "MISSISSIPPI".lastIndexOf('I')
Concept: undefined >> undefined
Define a class to accept two strings, convert them into uppercase, check and display whether two strings are equal or not, if the two strings are not equal, print the string with the highest length or print the message both the strings are of equal length.
Concept: undefined >> undefined
