A question bank for every class and subject
Practice questions, with answers and explanations included
794 questions available
Refine
All questions
794 resultsA method that returns the value of a private data member is called a:
Show answer
What is the purpose of the setEnabled() method for a jButton?
Show answer
Convert: 2 Bytes = ______ MB (Hint: use the conversion chain).
Show answer
A method that allows controlled modification of a private data member's value (possibly with validation) is called a:
Show answer
Differentiate between jTextField and jTextArea, and between jComboBox and jList.
Show answer
Convert: 3 Bytes = ______ MB (Hint: use the conversion chain).
Show answer
What is the main benefit of using getter and setter methods instead of allowing direct public access to data members?
Show answer
Which Java data type would be most appropriate to store a person's age (a small whole number)?
Show answer
Write an SQL query to display PrName and UnitPrice of products with unit price above 25000 from table GYM.
Show answer
Once a data member is declared private, it can still be accessed directly from outside the class using the dot operator.
Show answer
Which data type is used in Java to store a single character, enclosed in single quotes?
Show answer
Write an SQL query to display PrName and UnitPrice of products with unit price between 15000 and 25000 from table GYM.
Show answer
A constructor is called explicitly by the programmer using a special 'construct' statement.
Show answer
What is the storage size of the 'int' data type in Java?
Show answer
Write an SQL query to display PrName and UnitPrice of products manufactured by 'Fit Express' from table GYM.
Show answer
What is the difference between a Class and an Object? Give an example.
Show answer
Which operator is used to test whether two values are equal in Java?
Show answer
Write an SQL query to display PrName and UnitPrice of products whose manufacturer name starts with 'A' from table GYM.
Show answer
Why is a constructor used in a class?
Show answer
Which logical operator returns true only if BOTH connected conditions are true?