MCQOPTIONS
Saved Bookmarks
This section includes 1671 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
| 751. |
what does public String replaceAll(string replace) do? |
| A. | Replace all characters that matches pattern with replacement string |
| B. | Replace first subsequence that matches pattern with replacement string |
| C. | Replace all other than first subsequence of that matches pattern with replacement string |
| D. | Replace every subsequence of the input sequence that matches pattern with replacement string |
| Answer» E. | |
| 752. |
What does public int end(int group) return? |
| A. | offset from last character of the subsequent group |
| B. | offset from first character of the subsequent group |
| C. | offset from last character matched |
| D. | offset from first character matched |
| Answer» B. offset from first character of the subsequent group | |
| 753. |
Which of the following matches nonword character using regular expression in java? |
| A. | w |
| B. | W |
| C. | s |
| D. | S |
| Answer» C. s | |
| 754. |
Which capturing group can represent the entire expression? |
| A. | group * |
| B. | group 0 |
| C. | group * or group 0 |
| D. | None of the mentioned |
| Answer» C. group * or group 0 | |
| 755. |
Object of which class is used to compile regular expression? |
| A. | Pattern class |
| B. | Matcher class |
| C. | PatternSyntaxException |
| D. | None of the mentioned |
| Answer» B. Matcher class | |
| 756. |
What is the significance of Matcher class for regular expression in java? |
| A. | interpretes pattern in the string |
| B. | Performs match in the string |
| C. | interpreted both pattern and performs match operations in the string |
| D. | None of the mentioned. |
| Answer» D. None of the mentioned. | |
| 757. |
Which of the following is not a class of java.util.regex? |
| A. | Pattern class |
| B. | matcher class |
| C. | PatternSyntaxException |
| D. | Regex class |
| Answer» E. | |
| 758. |
Which of these formatting strings of SimpleDateFormat class is used to print AM or PM in time? |
| A. | a |
| B. | b |
| C. | c |
| D. | d |
| Answer» B. b | |
| 759. |
Which of these class allows us to define our own formatting pattern for dates and time? |
| A. | DefinedDateFormat |
| B. | SimpleDateFormat |
| C. | ComplexDateFormat |
| D. | UsersDateFormat |
| Answer» C. ComplexDateFormat | |
| 760. |
Which of these method returns an instance of DateFormat that can format time information? |
| A. | getTime() |
| B. | getTimeInstance() |
| C. | getTimeDateinstance() |
| D. | getDateFormatinstance() |
| Answer» C. getTimeDateinstance() | |
| 761. |
Which of this class can be used to format dates and times? |
| A. | Date |
| B. | SimpleDate |
| C. | DateFormat |
| D. | textFormat |
| Answer» D. textFormat | |
| 762. |
Which of these package is used for text formatting in Java programming language? |
| A. | java.text |
| B. | java.awt |
| C. | java.awt.text |
| D. | java.io |
| Answer» B. java.awt | |
| 763. |
Which of these operators can be used to get run time information about an object? |
| A. | getInfo |
| B. | Info |
| C. | instanceof |
| D. | getinfoof |
| Answer» D. getinfoof | |
| 764. |
Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program? |
| A. | transient |
| B. | volatile |
| C. | global |
| D. | No modifier is needed |
| Answer» C. global | |
| 765. |
Which of these methods is a part of Abstract Window Toolkit (AWT) ? |
| A. | display() |
| B. | paint() |
| C. | drawString() |
| D. | transient() |
| Answer» C. drawString() | |
| 766. |
Which of these methods can be used to output a string in an applet?vvvv |
| A. | display() |
| B. | print() |
| C. | drawString() |
| D. | transient() |
| Answer» D. transient() | |
| 767. |
Which of these functions is called to display the output of an applet? |
| A. | display() |
| B. | paint() |
| C. | displayApplet() |
| D. | PrintApplet() |
| Answer» C. displayApplet() | |
| 768. |
Which of these methods is used to write() into a file? |
| A. | put() |
| B. | putFile() |
| C. | write() |
| D. | writeFile() |
| Answer» D. writeFile() | |
| 769. |
Which of these values is returned by read() method is end of file (EOF) is encountered? |
| A. | 0 |
| B. | 1 |
| C. | 1 |
| D. | Null |
| Answer» D. Null | |
| 770. |
Which of these methods are used to read in from file? |
| A. | get() |
| B. | read() |
| C. | scan() |
| D. | readFileInput() |
| Answer» C. scan() | |
| 771. |
Which of these exception is thrown in cases when the file specified for writing it not found? |
| A. | IOException |
| B. | FileException |
| C. | FileNotFoundException |
| D. | FileInputException |
| Answer» D. FileInputException | |
| 772. |
Which of these class contains the methods used to write in a file? |
| A. | FileStream |
| B. | FileInputStream |
| C. | BUfferedOutputStream |
| D. | FileBufferStream |
| Answer» C. BUfferedOutputStream | |
| 773. |
Which of these classes are used by character streams output operations? |
| A. | InputStream |
| B. | Writer |
| C. | ReadStream |
| D. | InputOutputStream |
| Answer» C. ReadStream | |
| 774. |
Which of these methods can be used to writing console output? |
| A. | print() |
| B. | println() |
| C. | write() |
| D. | all of the mentioned |
| Answer» E. | |
| 775. |
Which of these class contains the methods print() & println()? |
| A. | System |
| B. | System.out |
| C. | BUfferedOutputStream |
| D. | PrintStream |
| Answer» E. | |
| 776. |
Which of these class is used to read from a file? |
| A. | InputStream |
| B. | BufferedInputStream |
| C. | FileInputStream |
| D. | BufferedFileInputStream |
| Answer» D. BufferedFileInputStream | |
| 777. |
Which of these class is implemented by FilterInputStream class? |
| A. | InputStream |
| B. | InputOutputStream |
| C. | BufferedInputStream |
| D. | SequenceInputStream |
| Answer» B. InputOutputStream | |
| 778. |
Which of these class is used to read characters and strings in Java from console? |
| A. | BufferedReader |
| B. | StringReader |
| C. | BufferedStreamReader |
| D. | InputStreamReader |
| Answer» B. StringReader | |
| 779. |
Which of these is used to read a string from the input stream? |
| A. | get() |
| B. | getLine() |
| C. | read() |
| D. | readLine() |
| Answer» D. readLine() | |
| 780. |
Which exception is thrown by read() method? |
| A. | IOException |
| B. | InterruptedException |
| C. | SystemException |
| D. | SystemInputException |
| Answer» B. InterruptedException | |
| 781. |
Which of these class is used to read from byte array? |
| A. | InputStream |
| B. | BufferedInputStream |
| C. | ArrayInputStream |
| D. | ByteArrayInputStream |
| Answer» E. | |
| 782. |
Which of these classes are used by character streams for input and output operations? |
| A. | InputStream |
| B. | Writer |
| C. | ReadStream |
| D. | InputOutputStream |
| Answer» C. ReadStream | |
| 783. |
Which of these classes are used by Byte streams for input and output operation? |
| A. | InputStream |
| B. | InputOutputStream |
| C. | Reader |
| D. | All of the mentioned |
| Answer» B. InputOutputStream | |
| 784. |
Which of these is a type of stream in Java? |
| A. | Integer stream |
| B. | Short stream |
| C. | Byte stream |
| D. | Long stream |
| Answer» D. Long stream | |
| 785. |
Which of these is used to perform all input & output operations in Java? |
| A. | streams |
| B. | Variables |
| C. | classes |
| D. | Methods |
| Answer» B. Variables | |
| 786. |
What does AWT stands for? |
| A. | All Window Tools |
| B. | All Writing Tools |
| C. | Abstract Window Toolkit |
| D. | Abstract Writing Toolkit |
| Answer» D. Abstract Writing Toolkit | |
| 787. |
Which of these method wakes up all the threads? |
| A. | wakeAll() |
| B. | notify() |
| C. | start() |
| D. | notifyAll() |
| Answer» E. | |
| 788. |
Which of these method wakes up the first thread that called wait()? |
| A. | wake() |
| B. | notify() |
| C. | start() |
| D. | notifyAll() |
| Answer» C. start() | |
| 789. |
Which of these method is used to tell the calling thread to give up monitor and go to sleep until some other thread enters the same monitor? |
| A. | wait() |
| B. | notify() |
| C. | notifyAll() |
| D. | sleep() |
| Answer» B. notify() | |
| 790. |
Which of these method is used to avoid polling in Java? |
| A. | wait() |
| B. | notify() |
| C. | notifyAll() |
| D. | all of the mentioned |
| Answer» E. | |
| 791. |
Which of these keywords are used to implement synchronization? |
| A. | synchronize |
| B. | syn |
| C. | synch |
| D. | synchronized |
| Answer» E. | |
| 792. |
Which of the following will ensure the thread will be in running state? |
| A. | yield() |
| B. | notify() |
| C. | wait() |
| D. | Thread.killThread() |
| Answer» D. Thread.killThread() | |
| 793. |
Which of the following stops execution of a thread |
| A. | Calling SetPriority() method on a Thread object |
| B. | Calling notify() method on an object |
| C. | Calling wait() method on an object |
| D. | Calling read() method on an InputStream object |
| Answer» C. Calling wait() method on an object | |
| 794. |
What is true about threading? |
| A. | run() method calls start() method and runs the code |
| B. | run() method creates new thread |
| C. | run() method can be called directly without start() method being called |
| D. | start() method creates new thread and calls code written in run() method |
| Answer» E. | |
| 795. |
What should not be done to avoid deadlock? |
| A. | Avoid using multiple threads |
| B. | Avoid hold several locks at once |
| C. | Execute foreign code while holding a lock |
| D. | Use interruptible locks |
| Answer» D. Use interruptible locks | |
| 796. |
Deadlock is a situation when thread is waiting for other thread to release acquired object? |
| A. | True |
| B. | False |
| Answer» B. False | |
| 797. |
What decides thread priority? |
| A. | Process |
| B. | Process scheduler |
| C. | Thread |
| D. | Thread scheduler |
| Answer» E. | |
| 798. |
What does not prevent JVM from terminating? |
| A. | Process |
| B. | Daemon Thread |
| C. | User Thread |
| D. | JVM Thread |
| Answer» C. User Thread | |
| 799. |
What requires less resources? |
| A. | Thread |
| B. | Process |
| C. | Thread and Process |
| D. | Neither Thread nor Process |
| Answer» B. Process | |
| 800. |
What will happen if two thread of same priority are called to be processed simultaneously? |
| A. | Anyone will be executed first lexographically |
| B. | Both of them will be executed simultaneously |
| C. | None of them will be executed |
| D. | It is dependent on the operating system |
| Answer» E. | |