Gaj Quiz For Aptech

58 Questions

Settings
Please wait...
Software Quizzes & Trivia

If you like answering specifically designed questions about GAJ quiz for Aptech try out this quiz. It is quite simple and straightforward therefore it will be easy to answer.


Questions and Answers
  • 1. 
    Annotations are comments, notes, explainations, or external remarks attached to a web document.
    • A. 

      True

    • B. 

      False

  • 2. 
    An Annotation declaration consits of ...........followed by th anotation type.1 choice.
    • A. 

      Data Type

    • B. 

      Character

    • C. 

      @

    • D. 

      @@

  • 3. 
    Annotations consist of names and have no value associated with it. It consist of the annotaion name and no additional data.
    • A. 

      Single - Value Annotations.

    • B. 

      Maker Annotations.

    • C. 

      Full Annotations.

  • 4. 
    Be Known as single - element, It consists of single value. It can be represented as data= value pair or value within the parenthese.
    • A. 

      Full Annotations.

    • B. 

      Maker Annotations.

    • C. 

      Single - Value Annotations.

  • 5. 
    This Annotation should not be used on classes, interfaces, package, or constructors. It should be used on method.
    • A. 

      @Deprecated

    • B. 

      @Documented.

    • C. 

      @suppressWarnings

    • D. 

      @Override

    • E. 

      @Interface

  • 6. 
    • A. 

      Parameters in annotation can be initialized with arrays of values

    • B. 

      Parameters in annotation can have null values

    • C. 

      Parameters in annotation are declared as a fields in a class.

    • D. 

      Parameters in annotation types may defne default values for some members.

    • E. 

      Parameters in annotation can be initialized to arrays of String values

  • 7. 
    • A. 

      Reflection API induces code into a particular set of classes during execution.

    • B. 

      Reflection API retrieves the object and its interface for examination.

    • C. 

      Reflection API cannot manipulate classes.

    • D. 

      Reflection API is used to get and set values in an array.

    • E. 

      Reflection API cannot be used to retrieve th constructors, methods and fields in a class.

  • 8. 
    • A. 

      Class name

    • B. 

      Constructors

    • C. 

      Class Field

    • D. 

      Package Information

    • E. 

      Method Information.

  • 9. 
    Create objects using default constructors?
    • A. 

      NewInstance() on class

    • B. 

      NewInstance() on Constructor

    • C. 

      GetField() on class

    • D. 

      Set()

    • E. 

      Invoke()

  • 10. 
    Create objects using prameterized constructors
    • A. 

      Invoke()

    • B. 

      GetField() on class

    • C. 

      Set()

    • D. 

      NewInstance() on Constructor

    • E. 

      NewInstance() on class

  • 11. 
    Retrieve field values using reflection.
    • A. 

      NewInstance() on Constructor

    • B. 

      Invoke()

    • C. 

      GetField() on class

    • D. 

      Set()

    • E. 

      NewInstance() on class

  • 12. 
    Assign field values using reflection.
    • A. 

      NewInstance() on Constructor

    • B. 

      GetField() on class

    • C. 

      Invoke()

    • D. 

      Set()

    • E. 

      NewInstance() on class

  • 13. 
    Invoke methods using refleftion.
    • A. 

      GetField() on class

    • B. 

      NewInstance() on Constructor

    • C. 

      Invoke()

    • D. 

      Set()

    • E. 

      NewInstance() on class

  • 14. 
    • A. 

      Array can be identified at runtime.

    • B. 

      Arrays can not be created at runtime.

    • C. 

      Values of arrays can be retrieved during runtime

    • D. 

      Values to elements can be assigned to arrays at runtime.

    • E. 

      Array objects cannot be instantiated.

  • 15. 
    This is matched with a character sequence string. This is called as input Sequence.
    • A. 

      Pattern Class

    • B. 

      Matcher Class

  • 16. 
    Matcher Class does not have any constructors.
    • A. 

      True

    • B. 

      False

  • 17. 
    Tries to match the input sequence against the pattern starting from beginning.
    • A. 

      Boolean find()

    • B. 

      Boolean lookingAt()

  • 18. 
    Returns the start index of the previous match.
    • A. 

      Int start()

    • B. 

      Int end()

  • 19. 
    Returns the start index of the last match plus one.
    • A. 

      Int end()

    • B. 

      Int start()

  • 20. 
    • A. 

      A regular exp consist of symbols and syntacic elements

    • B. 

      Pattern and Matcher class are the classes used to perform text processing

    • C. 

      The java.util.regex package consist of two classes

    • D. 

      Find and replace are some of the operations that can be performed by regex

    • E. 

      The regex package uses boolean matching

  • 21. 
    The basic form of pattern matching supported by regex- 1 choice.
    • A. 

      String Literal

    • B. 

      boolean

    • C. 

      Character-base

  • 22. 
    • A. 

      #

    • B. 

      { }

    • C. 

      [ ]

    • D. 

      @

    • E. 

      *

  • 23. 
    • A. 

      ?

    • B. 

      & &&

    • C. 

      . $

    • D. 

      ^ + -

    • E. 

      ! ,

  • 24. 
    This is a technique where all characters are matched except those listed. can be represented by inserting the metacharacter "^" at the beginning of character class. - 1 choice
    • A. 

      Simple Classes

    • B. 

      Negation

    • C. 

      Ranges

  • 25. 
    The UNION  is
    • A. 

      A single character class comprising of two or more separate character classes

    • B. 

      A single character class which matches to characters that are common to all its nested class

  • 26. 
    This is used to negate one or more nested character classes1 choice.
    • A. 

      Subtraction

    • B. 

      Union

    • C. 

      Greedy

  • 27. 
    The expression [a-z&&[^abc]]
    • A. 

      Matches everything from a->z, except a,b,c.

    • B. 

      Matches 'a','b' and 'c' that is common.

  • 28. 
    Represents A digit: [0-9]
    • A. 

      \d

    • B. 

      \D

    • C. 

      \A

  • 29. 
    Represents a non - whitespace character: [^\S]
    • A. 

      \S

    • B. 

      \s

    • C. 

      \W

  • 30. 
    Represents a word character:[a-zA-Z_0-9]
    • A. 

      \w

    • B. 

      \W

  • 31. 
    • A. 

      Simple class are formed by placing characters side by side

    • B. 

      Ranges define a character class that includes a single value

    • C. 

      Negation is a Technique where a metacharacter "^" is inserted at the beginning of character

    • D. 

      Subtraction is not used to negate one or more nested character classes

    • E. 

      To use an escape construct within a string literal, it must be preceded by a blackslash for the string to compile

  • 32. 
    Occurs when a Thread is not a state to receive a  request that has been made for a specific operation.
    • A. 

      InterruptedException

    • B. 

      IllegalThreadState

  • 33. 
    Occurs when Interrupt() or ThreadSleep() are called.
    • A. 

      IllegalThreadState

    • B. 

      InterruptedException

  • 34. 
    In a multithreading program two or more threads cannot run concurrently.
    • A. 

      True

    • B. 

      False

  • 35. 
    In a multitasking environment two or more processes run concurrently
    • A. 

      True

    • B. 

      False

  • 36. 
    • A. 

      Multithreading facilitates many parts of the same program to run simultaneously.

    • B. 

      Multithreading requires less overhead than multitasking

    • C. 

      Multithreading decreases performance of single processor systems, as it reduces the CPU idle time

    • D. 

      Multitasking is the ability to execute more than one task or program at the same time by Single Operation System

    • E. 

      Multitasking requires much lower overhead than Multithreading

  • 37. 
    This use to find out whether a specific thread is running or not.-1 choice
    • A. 

      Sleep()

    • B. 

      IsAlive()

    • C. 

      Join()

    • D. 

      Wait()

  • 38. 
    If the Thread is alive, the boolean value True is return. instead of that, return False value.
    • A. 

      True

    • B. 

      False

  • 39. 
    Causes the current Thread to wait until the thread on which it is called terminates.- 1 choice.
    • A. 

      Sleep()

    • B. 

      Join()

    • C. 

      Wait()

    • D. 

      IsAlive()

  • 40. 
    Join() method Throws  InterruptedException if another interrupts it.
    • A. 

      True

    • B. 

      False

  • 41. 
    Which statements are true?- 3 choices
    • A. 

      The isAlive() method sends a query to inquire, whether the Thread is running or not

    • B. 

      The join() method accomplishes the same task as the sleep() method

    • C. 

      The isAlive() method forces the current running thread to wait until the thread it is joining with no longer alive

    • D. 

      The isAlive() method returna a Boolean value

    • E. 

      The join() method doesnot throw an exception when another thread interrupts it

  • 42. 
    • A. 

      The race conditions can be avoided by using synchronized blocks

    • B. 

      The race conditions occur due to 2 or more threads sharing same data or reading and writing the share data simultaneously

    • C. 

      A Synchronized block is nothing but a statement or block of code qualified by synchronized keyword

    • D. 

      The Lock in synchronized block is based on the method and not on the object

    • E. 

      A lock allows multiple threads to access the code

  • 43. 
    This causes a Thread to wait for some other thread to release a resouce
    • A. 

      Wait()

    • B. 

      Notify()

  • 44. 
    Wait() method can only be invoked only from wthin the synchronised code
    • A. 

      True

    • B. 

      False

  • 45. 
    • A. 

      Java.lang package contains the System class from which you obtain input and output

    • B. 

      Java.lang package has class that contains complex scientific functions

    • C. 

      Java.lang package contains class pertaining to strings and buffers

    • D. 

      Java.lang package contains the Class class,is the root of the class hierarchy

    • E. 

      Java.lang package is imported by default in all programs

  • 46. 
    Java use primitive data types which are not part of the object hierarchy.
    • A. 

      True

    • B. 

      False

  • 47. 
    • A. 

      Integer

    • B. 

      Float

    • C. 

      Double

    • D. 

      Character

    • E. 

      String

  • 48. 
    • A. 

      Wrapper classes are used to manage primitive values as class

    • B. 

      All primitive data types do not have wrapper class

    • C. 

      Wrapper classes can be used without an import statement

    • D. 

      Wrapper classes compare values in classes

    • E. 

      Wrapper classes compare values in Objects and be defined in java.lang package

  • 49. 
    • A. 

      Double is a wrapper class for the floating point value of type float

    • B. 

      Character is a wrapper class for the primitive char data type

    • C. 

      A Constructor for the Byte Wrapper class can be written as Byte(bit value)

    • D. 

      A Constructor for the Long wrapper class can be written as Long(lg value)

    • E. 

      Integer is a wrapper class for the int data type.

  • 50. 
    A Constructor for the Double  wrapper class can be written  as
    • A. 

      Double(Double value),Double(String str)

    • B. 

      Double(double value)

    • C. 

      Double(double value),Double(String str)

  • 51. 
    The Class which defines methods for basic numeric operations are well as trigonometric functions is called:
    • A. 

      System class

    • B. 

      Class class

    • C. 

      Math class

  • 52. 
    The Class which subclass of all class.- 1 choice
    • A. 

      Class class

    • B. 

      Object Class

    • C. 

      ThreadGroup class

  • 53. 
    The class which consists of methods that operate at the group level, and attributes whose values are assigned and retrieved from the group
    • A. 

      Object class

    • B. 

      Runtime class

    • C. 

      ThreadGroup Class

  • 54. 
    This is a way by which programmers can specify the byte of objects that a class can work with via parameters passed at declaration time and evaluated at compile time.
    • A. 

      Wildcard

    • B. 

      Regular Expression

    • C. 

      Generic

  • 55. 
    • A. 

      "?" -denotes the set of all types or any in generic

    • B. 

      "? extends Type" -denotes a family of subtypes which extends "Type"

    • C. 

      "? extends Type" - denotes a family of subtypes of type "Type"

    • D. 

      "? super Type" - denotes a family of supertypes which is a subtype of "Type"

    • E. 

      "? super Type" -denotes a family of supertypes of type "Type".

  • 56. 
    • A. 

      System.err is an output stream.

    • B. 

      System.in is an input stream that responds to keyboard input.

    • C. 

      A stream produces and consumes information.

    • D. 

      Stream does not help in sharing of data over computer network.

    • E. 

      All Input/output operations are done without the help of stream.

  • 57. 
    Methods of DataInputStream are used to:- 2 choices.
    • A. 

      Read bytes from a binary stream and convert the data to any of the java primitive types.

    • B. 

      Convert data present in java primitive type into a series of bytes and write them onto a binary stream.

    • C. 

      Convert data from Java modified UTF 8 format into string form.

    • D. 

      Convert string data into java modified UTF-8 format and write it into a stream.

  • 58. 
    Methods of this class allows to create, delete and rename files, provide access to the pathfile.., check the read and write access permission.
    • A. 

      FileInputStream class

    • B. 

      FileOutputStream class.

    • C. 

      File class