Java interview preparation Quiz 2 Welcome to your Fresher Interview Preparation - Java Skills - 2 Name Email Phone Number 1. ____________ replaces the first occurrence.datareplacereplacefirstnone2. Java provides the _______________ package for pattern matching with regular expressionsjavanonejava.util.regexregex3. __________ is a keyword in java which is used as a references to the object of the current class.nonethatwhythis4. ____________ is used to invoke an exception explicitly.noneaddressthrowdata5. _______________ are useful methods for replacing text in an input string.datamethodsnonereplacement methods6. ____________ can be passed by value or by reference.parametersvaluedatanone7. A __________ that will be called just before an object final destruction by the garbage collectordatafunctionfinalize()none8. The ______________ returns the start index of the subsequence captured by the given groupduring the previous match operation.start methodsdata methodsnoneend methods9. There are __________ categories of exceptions and errorsnoneonethreetwo10. All ____________ classes are subtypes of the java.lang.exception class.exceptionobjectclassnone11. _______________ is used to output the data produced by the user's program.standardnonestandard ouputoutput12. A ____________ is an exception that occurs at the compile time, these are also called ascompile time exceptions.noneRuntime exceptionstimedata13. _______________ streams are used to perform input and output for 16-bit unicode.dataJava characternonealphabet14. A _____________ initializes an object when it is created.constructornonedestructordata15. There are ___________ useful file utility methods, which can be used to create directories.onetwononethree16. A _____________ is an unchecked exception that indicates a syntax error in a regularexpression pattern.datanonepatternpatternsyntaxexception17. The Java.util.regex package primarily consist of the following ___________ classes:noneonetwothree18. A ___________ is a collection of statements that are grouped together to perform an operation.methodJava methodnonedata method19. The ____________ method creates a directory, returning true on success and false on failure.mkdir()dir()nonemk20. A _____________ constructor that accepts one or more parameters.functionsdatanoneparameterized21. _________________ are a way to treat multiple characters as a single unit.userscapturing groupsdatanone22. A __________ can be defined as a sequence of data.datanonedreamstream23. A ______________ argument is the information that directly follows the programs name on thecommand line when it is executed.command linedatafunctionnone24. ______________ review the input string and return a boolean indicating whether or not thepattern founddatastudy methodsmethodsnone25. We can use ___________ method provided by file object to list down all the files anddirectories available in a directory.noneisted()li()list()26. A ______________ is the engine that interprets the pattern and performs match operationsagainst an input string.objectMatcher classclassnone27. An _____________ is a problem that arises during the execution of a program.errornonehandleexception28. The ______________ is used for writing data to the destination.noneInputstreamstreamOutputstream29. ___________ are exceptions/errors that are exclusively or logically thrown by the JVM.exceptionsnoneJVM Exceptionsdata30. _____________ streams are used to perform input and output of 8-bit bytes.noneJava bytedata bytechar byte31. The throws keyword appears at the ______ of a method's signature.datastartendnone32. The Exception class has ________ main subclasses.threenonefourtwo33. A _____________ expression is a special sequence of characters that helps you match or findother strings or set of strings, using a specialized syntax in a pattern.structureRegularExpressionnone34. The ___________ returns the index of the last character matched , plus one.start methodsend methodsnonedata35. A method catches an exception using a combination of the try and catch keywords is known as__________.catching exceptionsnoneaddressdata36. ________________ provide useful index value that show precisely where the match was foundin the input string.methodsnoneindexIndex methods37. The ___________ is used to read data from a source.Inputstreamstreamnoneoutputstream38. ____________________ is a new exception handling mechanism that was introduced in Java7 , which automatically closes the resources used within the try catch block.addressdatanoneautomatic resource management39. A _____________ object is an unchecked exception that indicates a syntax error in a regularexpression pattern.patternsyntaxexceptionobjectnonesyntax40. An ____________ is an exception that occurs at the time of execution.timeRuntime exceptionsdatanone41. ____________ is used to output the error data produced by the user's program.nonedataStandard errorStandard42. _______________ is used to feed the data to user's programstandardstandard inputnoneinput43. ___________ is a concrete implementation of a calendar class that implements the normalgregorian calendar.functionsgregoriancalendarnonedate44. The __________ allows us to create methods which do not return a value.structurenonedatavoid keyword.45. _____________ replaces all occurrences.replaceAllreplacecatnone46. The __________ follows a try block or a catch block.datablockfinally blocknone47. The ______________ method creates both a directory and all the parents of the directory.nonemkdirs()mkmkdir()48. When a class has two or more methods by the same name but different parameters, it is knownas ____________.method overloadingfunctionnonedata49. A _____________ is a compiled representation of a regular expression.pattern objectmatcher classnoneobject50. _____________ is used to postpone the handling of a checked exception.nonethrowdatathrowsPlease fill in the comment box below. Time is Up!