A question bank for every class and subject
Practice questions, with answers and explanations included
794 questions available
Refine
All questions
794 resultsWrite an SQL query to display PrName and UnitPrice of products whose name contains the word 'Exerciser' from table GYM.
Show answer
Design a Java class 'Book' with private data members Title, Author, Publisher, Genre (all String) and Price (double). Include a parameterized constructor, a getter and setter for Price (the setter should not allow price below 100), and a display() method.
Show answer
Which method converts a String value to an int in Java?
Show answer
Write an SQL query to display Name and cost of shoes with size greater than 8 from table Shoes.
Show answer
Which keyword is used to bring a prebuilt Java class into a program for use?
Show answer
Which method converts an integer value to a String in Java?
Show answer
Write an SQL query to display Name and cost of shoes with cost less than 2000 from table Shoes.
Show answer
Which prebuilt class, from the java.util package, is commonly used to take user input from the console?
Show answer
In the code: if(condition) { statementBlock1; } else { statementBlock2; } — what happens if the condition evaluates to false?
Show answer
Write an SQL query to display Name and cost of shoes of type 'Sports' from table Shoes.
Show answer
Which Scanner method reads the next token from the input stream and returns it as a String?
Show answer
Curly braces {} are mandatory around a statement block in an if statement when:
Show answer
Write an SQL query to display Name and cost of shoes with quantity in stock less than 10 from table Shoes.
Show answer
Which static method of the Integer class converts a String to its integer equivalent?
Show answer
A switch statement is generally preferred over multiple if/else-if statements when:
Show answer
Write the SQL statement to display the structure of the table 'Shoes'.
Show answer
Which class (from java.util) provides prebuilt methods like sort() and binarySearch() for manipulating arrays?
Show answer
In Java, a variable must be declared before it can be used.
Show answer
Write the SQL statement to view the names of all tables in the currently selected database.
Show answer
What must be true about an array BEFORE using Arrays.binarySearch() on it?