McqMate
These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Bachelor of Computer Applications (BCA) , Bachelor of Science in Computer Science (BSc CS) , Master of Computer Applications (MCA) , Programming Languages .
| 551. |
_________ is a feature that allows one interface to be used for a general class of actions. |
| A. | Class. |
| B. | Inheritance. |
| C. | Polymorphism. |
| D. | Interface. |
| Answer» C. Polymorphism. | |
| 552. |
What method must be implemented by all threads? |
| A. | run() method |
| B. | call() method |
| C. | super() method |
| D. | none of the above |
| Answer» A. run() method | |
| 553. |
The term _____________ refers to a class's direct ancestor or to any of its ascendant.~~~classes. |
| A. | sub class. |
| B. | super class. |
| C. | class hierarchy. |
| D. | class instance. |
| Answer» B. super class. | |
| 554. |
A single-line comment begins with a ________ and ends at the end of the line. |
| A. | / . |
| B. | // . |
| C. | /* . |
| D. | **. |
| Answer» B. // . | |
| 555. |
__________ code segments must be implemented for an event handler. |
| A. | one. |
| B. | two. |
| C. | three. |
| D. | four. |
| Answer» C. three. | |
| 556. |
A class is declared by use of the ________ keyword. |
| A. | object. |
| B. | class. |
| C. | instance. |
| D. | method. |
| Answer» B. class. | |
| 557. |
The new operator dynamically allocates ________ for an object and returns a reference to it. |
| A. | classes. |
| B. | variables. |
| C. | memory. |
| D. | none of the above. |
| Answer» C. memory. | |
| 558. |
Method overloading is one of the way that Java supports ____________. |
| A. | encapsulation. |
| B. | class. |
| C. | inheritence. |
| D. | polymorphism. |
| Answer» D. polymorphism. | |
| 559. |
Does a class inherit the constructors of its super class? |
| A. | Yes |
| B. | Sometimes Yes |
| C. | Always No |
| D. | Sometimes no |
| Answer» C. Always No | |
| 560. |
Methods declared as static have several restrictions:~~~1) They can only call other static methods.~~~2) They must only access static data.~~~3) They cannot refer to this or super in any way~~~Which of these are true? |
| A. | 1 and 2. |
| B. | 1 and 3. |
| C. | 2 and 3. |
| D. | 1, 2 and 3. |
| Answer» D. 1, 2 and 3. | |
| 561. |
finalize( ) is only called just prior to _________. |
| A. | initialization. |
| B. | runtime. |
| C. | garbage collection. |
| D. | destruction. |
| Answer» C. garbage collection. | |
| 562. |
The data or variables, defined within a class are called _______ variables. |
| A. | object. |
| B. | class. |
| C. | instance. |
| D. | schema. |
| Answer» C. instance. | |
| 563. |
In this example class_var = new classname ( ); the class name followed by parentheses~~~specifies the _________ for the class. |
| A. | destructor. |
| B. | constructor. |
| C. | variables. |
| D. | memory. |
| Answer» B. constructor. | |
| 564. |
What is meant by timeslicing or time sharing? |
| A. | Timeslicing is the method of de-allocating CPU time to individual threads in a priority schedule. |
| B. | Timeslicing is the method of allocating CPU space to individual threads in a priority schedule. |
| C. | Timeslicing is the method of allocating CPU time to individual threads in a priority schedule. |
| D. | Timeslicing is the method of de-allocating CPU space to individual threads in a priority schedule. |
| Answer» A. Timeslicing is the method of de-allocating CPU time to individual threads in a priority schedule. | |
| 565. |
Which of the following statements correctly describes an interface? |
| A. | It's a concrete class. |
| B. | It's a superclass. |
| C. | It's a type of abstract class. |
| D. | It's a subclass. |
| Answer» C. It's a type of abstract class. | |
| 566. |
You would use the ____ operator to create a single instance of a named class. |
| A. | new. |
| B. | dot. |
| C. | equals. |
| D. | <>. |
| Answer» A. new. | |
| 567. |
Java's garbage collector runs as a ______ priority thread waiting for _______ priority threads to relinquish the processor. Choose the correct sequence. |
| A. | high, low. |
| B. | high, high. |
| C. | low, low. |
| D. | low, high. |
| Answer» A. high, low. | |
| 568. |
What is the default thread at the time of starting the program? |
| A. | Main Thread. |
| B. | Thread Group. |
| C. | Child Thread. |
| D. | Thread Pool. |
| Answer» A. Main Thread. | |
| 569. |
What is the use of valueOf( ) method? |
| A. | It converts data from its internal format into a human-readable form. |
| B. | It converts integer value to string. |
| C. | It converts string to int value. |
| D. | It converts string to float value. |
| Answer» D. It converts string to float value. | |
| 570. |
What are the part in executing a Java program and their purposes? |
| A. | Java Compiler. |
| B. | Java Interpreter. |
| C. | Java Pre-processor. |
| D. | Directive Pre-processor. |
| Answer» A. Java Compiler. | |
| 571. |
What is the priority of the Garbage collector thread of jdk? |
| A. | Low-Priority. |
| B. | Highest Priority. |
| C. | Medium Priority. |
| D. | Decided At Runtime. |
| Answer» A. Low-Priority. | |
| 572. |
What are the constants defined by Byte, Short, Integer and Long? 1. MAX_VALUE, 2.~~~MIN_VALUE 3. TYPE. |
| A. | 1, 2. |
| B. | 2, 3. |
| C. | 1, 2, 3. |
| D. | 1, 3. |
| Answer» C. 1, 2, 3. | |
| 573. |
What is the unit for 1000 in the below statement? ob.sleep(1000) |
| A. | Long milliseconds. |
| B. | Double milliseconds. |
| C. | Int milliseconds. |
| D. | Float milliseconds. |
| Answer» A. Long milliseconds. | |
| 574. |
What will be the result of compiling the following code?~~~public class Test~~~{~~~static int age;~~~public static void main (String args [])~~~{~~~age = age + 1;~~~System.out.println("The age is " + age);~~~}~~~} |
| A. | Compiles and runs with no output. |
| B. | Compiles and runs printing out The age is 1. |
| C. | Compiles but generates a runtime error. |
| D. | Compiles but generates a compile time error. |
| Answer» B. Compiles and runs printing out The age is 1. | |
| 575. |
Which of the following helps in garbage collection? |
| A. | Final. |
| B. | Finally. |
| C. | Finalize. |
| D. | Finalizer. |
| Answer» C. Finalize. | |
| 576. |
__________ is an applet tag. |
| A. | (applet). |
| B. | >applet<. |
| C. | <applet>. |
| D. | <applet tag>. |
| Answer» C. <applet>. | |
| 577. |
When you divide a number of type double by zero then the result will be __________. |
| A. | zero. |
| B. | double.NaN. |
| C. | unpredictable. |
| D. | predictable. |
| Answer» B. double.NaN. | |
| 578. |
What will happen when the class below is complied?~~~public class Example~~~{~~~//char a = 'u000A';~~~} |
| A. | Will complete successfully. |
| B. | Will compile successfully but with a warning message. |
| C. | Will not compile - complains on an invalid expression. |
| D. | Will show a warning message. |
| Answer» A. Will complete successfully. | |
| 579. |
Codebase attribute in applet tag is used for _________. |
| A. | internet access. |
| B. | class file name. |
| C. | base URL for class file. |
| D. | creating base class. |
| Answer» C. base URL for class file. | |
| 580. |
What is the number of bytes used by Java primitive long? |
| A. | The number of bytes is compiler dependent. |
| B. | 2. |
| C. | 4. |
| D. | 8. |
| Answer» D. 8. | |
| 581. |
Which of the function is used to convert String to Number in java program? |
| A. | toNumber (). |
| B. | conString(). |
| C. | valueOf() . |
| D. | toString(). |
| Answer» C. valueOf() . | |
| 582. |
Interface methods can be declared with which the following modifiers? |
| A. | public. |
| B. | private. |
| C. | synchronized. |
| D. | native. |
| Answer» A. public. | |
| 583. |
The class that inherits is called a __________. |
| A. | superclass. |
| B. | subclass. |
| C. | instance class. |
| D. | instantiate class. |
| Answer» B. subclass. | |
| 584. |
All the wrapper classes (Integer, Boolean, Float, Short, Long, Double and Character). |
| A. | are public. |
| B. | are final. |
| C. | are serializable. |
| D. | are private. |
| Answer» D. are private. | |
| 585. |
What is the file extension of compiled java program? |
| A. | .class. |
| B. | .java. |
| C. | .css. |
| D. | .html. |
| Answer» A. .class. | |
| 586. |
Can you write a Java class that could be used both as an applet as well as an application? |
| A. | Yes |
| B. | No |
| C. | - |
| D. | - |
| Answer» A. Yes | |
| 587. |
A subclass is also called as ____________. |
| A. | inner class. |
| B. | nested class. |
| C. | derived class. |
| D. | hidden class. |
| Answer» C. derived class. | |
| 588. |
____________ is not a package in java. |
| A. | awt. |
| B. | net. |
| C. | io. |
| D. | ip. |
| Answer» D. ip. | |
| 589. |
What is the output of the following program?
|
| A. | The program does not compile as j is not initialized. |
| B. | The program compiles but does not run. |
| C. | The program compiles and runs but does not print anything. |
| D. | The program prints 0. |
| Answer» A. The program does not compile as j is not initialized. | |
| 590. |
_____ is used to manage the memory allocation. |
| A. | New. |
| B. | Keyword. |
| C. | Const. |
| D. | Allow. |
| Answer» A. New. | |
| 591. |
AWT stands for_________________. |
| A. | abstract window toolkit. |
| B. | abstract window toolbar. |
| C. | access window toolkit. |
| D. | access window toolbar. |
| Answer» A. abstract window toolkit. | |
| 592. |
Polymorphism is derived from a ___________ word. |
| A. | greek |
| B. | English |
| C. | java |
| D. | Indian |
| Answer» A. greek | |
| 593. |
Integers are whole values ________ numbers. |
| A. | signed. |
| B. | unsigned. |
| C. | model. |
| D. | Byte. |
| Answer» A. signed. | |
| 594. |
Single characters are represented through ______ type. |
| A. | String. |
| B. | char. |
| C. | array. |
| D. | nothing. |
| Answer» B. char. | |
| 595. |
Numbers with fractional are called __________. |
| A. | double. |
| B. | float. |
| C. | int. |
| D. | long. |
| Answer» B. float. | |
| 596. |
Single character in java is called _____literals. |
| A. | char. |
| B. | String. |
| C. | java. |
| D. | compile. |
| Answer» A. char. | |
| 597. |
The ______ refers to the validity of a variable. |
| A. | scope. |
| B. | variable. |
| C. | float. |
| D. | method. |
| Answer» A. scope. | |
| 598. |
Which of the following is not a class? |
| A. | TextField. |
| B. | Label. |
| C. | Int. |
| D. | Scrollbar. |
| Answer» C. Int. | |
| 599. |
Package is a collection of __________. |
| A. | classes. |
| B. | variables. |
| C. | functions. |
| D. | concept. |
| Answer» A. classes. | |
| 600. |
The dot operator is used to access the instance ______. |
| A. | object. |
| B. | variable. |
| C. | model. |
| D. | value. |
| Answer» B. variable. | |
Done Studing? Take A Test.
Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.