Gaj Quiz For Aptech

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Vietha
V
Vietha
Community Contributor
Quizzes Created: 11 | Total Attempts: 9,911
| Attempts: 629 | Questions: 58
Please wait...
Question 1 / 58
0 %
0/100
Score 0/100
1. Annotations are comments, notes, explainations, or external remarks attached to a web document.

Explanation

Annotations are indeed comments, notes, explanations, or external remarks that are attached to a web document. These annotations can provide additional information or context to the content of the document, helping users better understand the information presented. They can be used for various purposes, such as highlighting important points, clarifying complex concepts, or providing references to related resources. Overall, annotations play a valuable role in enhancing the usability and comprehensibility of web documents.

Submit
Please wait...
About This Quiz
Gaj Quiz For Aptech - Quiz

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.

Tell us your name to personalize your report, certificate & get on the leaderboard!
2. Invoke methods using refleftion.

Explanation

The correct answer is "invoke()". The invoke() method is used in reflection to dynamically invoke methods on an object. It allows us to call a method by providing the method name as a string and passing the required arguments. This method is commonly used when the method name or the number of arguments is not known at compile time. Therefore, invoke() is the appropriate choice for invoking methods using reflection.

Submit
3. Returns the start index of the previous match.

Explanation

The method "int start()" is likely a part of a larger program or function that is used to find matches or occurrences of something. The purpose of this method is to return the start index of the previous match that was found. It allows the program to keep track of where the matching pattern or element was found in the string or data being searched. By returning the start index, the program can then perform further operations or calculations based on the location of the match.

Submit
4. Occurs when Interrupt() or ThreadSleep() are called.

Explanation

InterruptedException is the correct answer because it is thrown when a thread is waiting, sleeping, or occupied with some other task, and it is interrupted by calling the interrupt() method or when the thread's sleep is interrupted by calling the Thread.sleep() method. This exception is used to handle situations where a thread is waiting or sleeping and needs to be forcefully interrupted.

Submit
5. If the Thread is alive, the boolean value True is return. instead of that, return False value.

Explanation

The explanation for the given correct answer is that if the thread is alive, it means that the thread is currently running and has not terminated yet. In this case, the boolean value True is returned. However, if the thread is not alive, it means that the thread has either not started or has already terminated. In this case, the boolean value False is returned.

Submit
6. The expression [a-z&&[^abc]]

Explanation

The given regular expression [a-z&&[^abc]] matches any lowercase letter from a to z, excluding the letters a, b, and c. It does not match the letters a, b, or c, but matches any other lowercase letter in the English alphabet.

Submit
7. In a multitasking environment two or more processes run concurrently

Explanation

In a multitasking environment, two or more processes are able to run concurrently, meaning that they can execute simultaneously. This allows for efficient utilization of system resources and improves overall system performance.

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

Explanation

The given correct answer is "Single - Value Annotations". Single - Value Annotations are annotations that consist of a single value. They can be represented as a data= value pair or a value within parentheses. Unlike Full Annotations and Maker Annotations, Single - Value Annotations do not have additional information or multiple values associated with them.

Submit
9. Represents A digit: [0-9]

Explanation

The correct answer \d represents a digit from 0 to 9. It is a shorthand character class in regular expressions that matches any single digit.

Submit
10. Returns the start index of the last match plus one.

Explanation

The end() function returns the start index of the last match plus one. This means that it gives the index immediately after the last character of the matched substring.

Submit
11. Join() method Throws  InterruptedException if another interrupts it.

Explanation

The join() method in Java is used to wait for a thread to die. If another thread interrupts the thread that is waiting with join(), it will throw an InterruptedException. Therefore, the given answer, "True," is correct.

Submit
12. Retrieve field values using reflection.

Explanation

The getField() method is used to retrieve the value of a specific field in a class using reflection. It allows access to the field's value regardless of its access modifier (public, private, etc.). This method is commonly used when you want to dynamically access and manipulate the values of fields in a class at runtime.

Submit
13. An Annotation declaration consits of ...........followed by th anotation type.
1 choice.

Explanation

An Annotation declaration consists of the "@" symbol followed by the annotation type.

Submit
14. Represents a word character:[a-zA-Z_0-9]

Explanation

The correct answer is \w. This regular expression represents a word character, which includes uppercase and lowercase letters, numbers, and the underscore character. It matches any single character that falls into this category.

Submit
15. Create objects using prameterized constructors

Explanation

The correct answer is "NewInstance() on Constructor." The NewInstance() method is used to create a new instance of a class using its constructor. It allows you to dynamically create objects at runtime by invoking the constructor with the specified parameters. This method is typically used when you don't know the class name at compile time and need to create objects dynamically based on user input or other runtime conditions.

Submit
16. Assign field values using reflection.

Explanation

The set() method is used to assign a value to a field using reflection. It allows you to set the value of a field even if it is private or inaccessible through normal means. This method is commonly used when you need to dynamically modify the value of a field at runtime.

Submit
17. Matcher Class does not have any constructors.

Explanation

The statement is true because the Matcher class in Java does not have any constructors. This means that we cannot create an instance of the Matcher class using the new keyword. Instead, we obtain a Matcher object by invoking the matcher() method on a Pattern object. The Matcher class is used for performing match operations on a character sequence using regular expressions.

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

Explanation

The ThreadGroup class is the correct answer because it consists of methods that operate at the group level, allowing for the management of multiple threads as a single unit. It also has attributes whose values can be assigned and retrieved from the group, providing a way to control and manipulate the threads within the group. This class is specifically designed for managing thread groups in Java.

Submit
19. This use to find out whether a specific thread is running or not.
-1 choice

Explanation

The correct answer is "isAlive()". This method is used to determine whether a specific thread is currently running or not. It returns a boolean value indicating the thread's status. If the thread is running, the method will return true; otherwise, it will return false. This can be helpful in situations where we need to check the status of a thread and perform certain actions based on its status.

Submit
20. Java use primitive data types which are not part of the object hierarchy.

Explanation

Java uses primitive data types such as int, float, boolean, etc., which are not part of the object hierarchy. Unlike objects, primitive data types are not represented as instances of a class and do not have any methods or properties associated with them. They are used to store simple values directly in memory, making them more efficient in terms of memory usage and performance compared to objects. Therefore, the statement "Java uses primitive data types which are not part of the object hierarchy" is true.

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

Explanation

The File class is the correct answer because it provides methods to create, delete, and rename files, as well as access the pathfile and check read and write access permissions. The FileInputStream and FileOutputStream classes are used for reading from and writing to files, respectively, but they do not provide the same functionality as the File class.

Submit
22. The Class which defines methods for basic numeric operations are well as trigonometric functions is called:

Explanation

The Math class in Java defines methods for basic numeric operations as well as trigonometric functions. It provides functionality to perform mathematical calculations such as finding the square root, rounding numbers, calculating logarithms, and more. This class is a part of the Java standard library and is widely used in mathematical computations.

Submit
23. This causes a Thread to wait for some other thread to release a resouce

Explanation

The wait() method in Java causes a thread to wait for some other thread to release a resource. When a thread encounters the wait() method, it releases the lock it holds and enters a waiting state until another thread notifies it. This mechanism allows threads to synchronize their actions and coordinate their execution. By using wait() and notify() methods, threads can communicate and avoid resource contention issues.

Submit
24. Wait() method can only be invoked only from wthin the synchronised code

Explanation

The wait() method in Java is used for inter-thread communication and can only be invoked within synchronized code. When a thread calls the wait() method, it releases the lock it holds and enters a waiting state until another thread notifies it. This is why the wait() method must be called from within synchronized code, as it ensures that the thread calling wait() holds the lock on the object it is waiting on. If the wait() method is called outside synchronized code, it will throw an IllegalMonitorStateException. Therefore, the given answer "True" is correct.

Submit
25. Annotations consist of names and have no value associated with it. It consist of the annotaion name and no additional data.

Explanation

The given correct answer is "Maker Annotations". This is because the question states that annotations consist of names and have no value associated with them. Maker Annotations align with this description as they only consist of the annotation name and do not include any additional data or values.

Submit
26. This Annotation should not be used on classes, interfaces, package, or constructors. It should be used on method.

Explanation

The "@Override" annotation is used in Java to indicate that a method is intended to override a method from a superclass or interface. This annotation helps to ensure that the method is correctly overriding the intended method and provides compile-time checking for errors. It is typically used when implementing abstract methods or overriding methods from a superclass.

Submit
27. This is used to negate one or more nested character classes
1 choice.

Explanation

This answer is correct because the term "subtraction" refers to the use of the negation or exclusion operator within regular expressions. It is used to remove characters or character classes from a larger set. In this context, "nested character classes" refers to character classes that are enclosed within another character class. The use of subtraction allows for the removal of these nested character classes, resulting in a more specific and refined search pattern.

Submit
28. This is matched with a character sequence string. This is called as input Sequence.

Explanation

The correct answer is "Pattern Class" because the question mentions that the character sequence string is matched with a class, and specifically refers to "Pattern Class" as the answer.

Submit
29. Tries to match the input sequence against the pattern starting from beginning.

Explanation

The method "lookingAt()" is used to determine if the input sequence matches the pattern starting from the beginning. It checks if the pattern is found at the beginning of the input sequence, but does not need to match the entire input sequence. On the other hand, the "find()" method searches for any occurrence of the pattern in the input sequence, not necessarily starting from the beginning. Therefore, the correct answer is "boolean lookingAt()".

Submit
30. 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

Explanation

This technique is called negation, where all characters except those listed are matched. By inserting the metacharacter "^" at the beginning of a character class, it indicates that any character that is not listed should be matched.

Submit
31. Which of the following details are not retrieved when a class is examined?

Explanation

When a class is examined, the package information is not retrieved. The package information refers to the details about the package in which the class is located, such as the package name and any related documentation. The class name, constructors, class fields, and method information are all retrieved when examining a class.

Submit
32. The basic form of pattern matching supported by regex
- 1 choice.

Explanation

The correct answer is "String Literal" because a string literal is a sequence of characters enclosed in double quotation marks. In regex, pattern matching can be done by specifying the exact string literal that needs to be matched. This allows for precise matching of specific strings in a given text or input.

Submit
33. Create objects using default constructors?

Explanation

The correct answer is "NewInstance() on class". The NewInstance() method is used to create a new instance of a class using its default constructor. This method is part of the Java Reflection API and allows you to dynamically create objects at runtime. By calling NewInstance() on a class, you can create an object without explicitly calling its constructor.

Submit
34. Which statements are true ?
- 3 choices

Explanation

not-available-via-ai

Submit
35. In a multithreading program two or more threads cannot run concurrently.

Explanation

The given statement is false. In a multithreading program, two or more threads can indeed run concurrently. Each thread is an independent sequence of instructions that can be executed simultaneously with other threads. This allows for parallel execution and can lead to improved performance and responsiveness in certain scenarios.

Submit
36. The UNION  is

Explanation

The correct answer is a single character class comprising of two or more separate character classes. This means that the UNION operator allows us to create a single character class by combining multiple separate character classes. This allows us to match any character that belongs to any of the individual character classes within the UNION.

Submit
37. Represents a non - whitespace character: [^\S]

Explanation

The correct answer is \S. In regular expressions, \S represents a non-whitespace character. It matches any character that is not a space, tab, or newline.

Submit
38. Which are Metacharacters?
- 3 choices

Explanation

The correct answer is { }, [ ], *.

In regular expressions, metacharacters are special characters that have a symbolic meaning. The curly braces { } are metacharacters used to specify the number of occurrences of a pattern. The square brackets [ ] are used to define a character class, allowing any character within the brackets to match. The asterisk * is a metacharacter used to match zero or more occurrences of the preceding pattern. The hashtag # and the at symbol @ are not metacharacters in this context.

Submit
39. 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.

Explanation

Generics in programming allow programmers to specify the type of objects that a class can work with by using parameters passed at declaration time. These parameters are evaluated at compile time, allowing for type safety and flexibility in working with different data types. By using generics, programmers can create reusable code that can work with multiple types of objects without the need for type casting or duplication of code.

Submit
40. Which statements are true?
- 3 choices

Explanation

The given answer is correct. The Reflection API allows code to be dynamically induced into a particular set of classes during execution. It also allows the retrieval of an object and its interface for examination. Additionally, the Reflection API can be used to get and set values in an array.

Submit
41. Which are not metacharacter?
- 2  choices

Explanation

The metacharacters are special characters with a special meaning in regular expressions. In this case, the metacharacters are "&", "&&", and "!". These characters have a specific purpose when used in regular expressions and are not considered regular characters. The other options, "?", ".", "$", "^", "+", "-", and ",", are not metacharacters as they do not have any special meaning in regular expressions and are treated as regular characters.

Submit
42. A Constructor for the Double  wrapper class can be written  as

Explanation

The Double wrapper class in Java provides constructors that can accept either a double value or a String representation of a double value. The constructor Double(double value), Double(String str) allows the creation of a Double object by passing in either a double value or a String representation of a double value. This constructor provides flexibility in creating Double objects and allows for easy conversion between different types of representations of double values.

Submit
43. Occurs when a Thread is not a state to receive a  request that has been made for a specific operation.

Explanation

The correct answer is "IllegalThreadState". This exception occurs when a thread is not in a state to receive a request that has been made for a specific operation. It typically happens when a method is called on a thread that is not in a valid state for that particular method. For example, if a thread is not yet started or has already terminated, and an attempt is made to call a method that is only valid for a running thread, the IllegalThreadState exception will be thrown.

Submit
44. The Class which subclass of all class.
- 1 choice

Explanation

The correct answer is Object Class because it is the superclass of all classes in Java. Every class in Java directly or indirectly extends the Object class. Therefore, it can be said that the Object class is the subclass of all classes.

Submit
45. Causes the current Thread to wait until the thread on which it is called terminates.
- 1 choice.

Explanation

The join() method is used to wait for the thread on which it is called to terminate. It causes the current thread to pause its execution and wait until the specified thread completes its execution. This is useful when we want to ensure that certain tasks are completed in a specific order or when we need to wait for a thread to finish before proceeding further in the program.

Submit
46. Which statements are true?
- 3 choices.

Explanation

The first statement is true. Simple classes are formed by placing characters side by side. For example, [abc] represents a character class that includes the characters a, b, and c.

The second statement is true. Ranges define a character class that includes a single value. For example, [a-z] represents a character class that includes all lowercase alphabets.

The third statement is true. Negation is a technique where a metacharacter "^" is inserted at the beginning of a character class. For example, [^a] represents a character class that includes all characters except for the character a.

The fourth statement is not mentioned in the question, so we cannot determine its truthfulness.

The fifth statement is true. To use an escape construct within a string literal, it must be preceded by a backslash for the string to compile. For example, to include a double quote within a string literal, it must be escaped as \".

Therefore, the correct statements are: Simple class are formed by placing characters side by side, Negation is a Technique where a metacharacter "^" is inserted at the beginning of a character, To use an escape construct within a string literal, it must be preceded by a backslash for the string to compile.

Submit
47. Which statements are true?
- 2 choices

Explanation

Double is not a wrapper class for the floating point value of type float. The correct answer is that Character is a wrapper class for the primitive char data type and Integer is a wrapper class for the int data type.

Submit
48. Which statements are true?
- 3 choices

Explanation

The given answer is correct. Parameters in annotation can be initialized with arrays of values, which means that multiple values can be passed as parameters in an annotation. Parameters in annotation types may define default values for some members, which means that if a parameter is not explicitly provided, it will take the default value defined in the annotation type. Parameters in annotation can be initialized to arrays of String values, which means that the values passed as parameters can be of type String and can be stored in an array.

Submit
49. Which statement are true?
- 3 choices.

Explanation

A regular expression consists of symbols and syntactic elements, such as metacharacters and quantifiers, which are used to define a pattern for matching strings. The pattern and Matcher class are the classes used in Java to perform text processing with regular expressions. The java.util.regex package consists of these two classes. Find and replace are some of the operations that can be performed using regular expressions. The regex package uses boolean matching to determine if a string matches a given pattern.

Submit
50. Which Statements are true?
- 3 choices

Explanation

Multithreading allows different parts of the same program to run simultaneously, which can improve efficiency and speed up execution. Multithreading also requires less overhead compared to multitasking, as it involves creating multiple threads within a single process rather than switching between different processes. On the other hand, multitasking refers to the ability to execute multiple tasks or programs at the same time, and it typically requires more overhead compared to multithreading.

Submit
51. Which Statement are true?
-  3 choices

Explanation

The first statement is true because synchronized blocks can be used to control access to shared data and avoid race conditions. The second statement is true because race conditions occur when multiple threads access and modify shared data simultaneously. The third statement is true because a synchronized block is a block of code that is qualified by the synchronized keyword. However, the fourth statement is false because the lock in a synchronized block is based on the object, not the method. The fifth statement is also false because a lock in a synchronized block only allows one thread to access the code at a time.

Submit
52. Which Types are not in Wrapper classes.
- 2 choices

Explanation

The types that are not included in the wrapper classes are float and String. Float is a primitive data type and does not have a corresponding wrapper class. String is not a primitive data type, but it is already a class in Java and does not need a wrapper class. The other options (Integer, Double, and Character) all have corresponding wrapper classes in Java.

Submit
53. Which statements are true?
- 3 choices.

Explanation

The correct answer states that "?" denotes the set of all types or any in generic. "? extends Type" denotes a family of subtypes of type "Type", and "? super Type" denotes a family of supertypes of type "Type". This explanation provides a clear understanding of the meanings behind each statement and how they relate to the concept of generics in programming.

Submit
54. Methods of DataInputStream are used to:
- 2 choices.

Explanation

The correct answer is "Read bytes from a binary stream and convert the data to any of the java primitive types." This is because the methods of DataInputStream are used to read bytes from a binary stream and then convert that data into any of the Java primitive types. This allows for the retrieval and manipulation of data stored in a binary format. Additionally, the correct answer is "Convert data from Java modified UTF 8 format into string form." This is because the methods of DataInputStream can also be used to convert data from the Java modified UTF-8 format into a string representation. This allows for the interpretation and utilization of data stored in this specific format.

Submit
55. Which statements are true?
- 3 choices

Explanation

The isAlive() method is used to check whether a thread is running or not. It sends a query to inquire about the thread's status. It returns a Boolean value indicating whether the thread is alive or not. Additionally, the isAlive() method can also be used to force the current running thread to wait until the thread it is joining with is no longer alive. This allows for synchronization between threads.

Submit
56. Which Statement are true?
- 3 choices.

Explanation

The explanation for the given correct answer is that the java.lang package contains the System class, which is used to obtain input and output in Java programs. It also contains classes that pertain to strings and buffers, such as the String and StringBuffer classes. Additionally, the java.lang package is imported by default in all programs, so there is no need to explicitly import it.

Submit
57. Which statements are true?
- 2 choices.

Explanation

System.in is an input stream that responds to keyboard input. This means that when we use System.in, we can read input from the keyboard in our program.

A stream produces and consumes information. Streams are used to transfer data between a program and an input/output device. They allow us to read data from a source (such as a file or the keyboard) and write data to a destination (such as a file or the screen). So, a stream can both produce and consume information.

Submit
58. Which Statements are true?
- 2 choices

Explanation

Wrapper classes are used to manage primitive values as class. This means that wrapper classes provide a way to use primitive data types as objects. For example, the Integer class can be used to represent an int value as an object.

All primitive data types do not have wrapper class. This statement is false because all primitive data types in Java have corresponding wrapper classes. For example, int has Integer, char has Character, etc.

Wrapper classes can be used without an import statement. This statement is true because the wrapper classes are part of the java.lang package, which is automatically imported in every Java program. Therefore, we can use wrapper classes without explicitly importing them.

Wrapper classes compare values in Objects and be defined in java.lang package. This statement is true because wrapper classes provide methods to compare values and perform other operations on objects. Additionally, all wrapper classes are defined in the java.lang package.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 21, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 30, 2008
    Quiz Created by
    Vietha
Cancel
  • All
    All (58)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Annotations are comments, notes, explainations, or external remarks...
Invoke methods using refleftion.
Returns the start index of the previous match.
Occurs when Interrupt() or ThreadSleep() are called.
If the Thread is alive, the boolean value True is return. instead of...
The expression [a-z&&[^abc]]
In a multitasking environment two or more processes run concurrently
Be Known as single - element, It consists of single value. It can be...
Represents A digit: [0-9]
Returns the start index of the last match plus one.
Join() method Throws  InterruptedException if another interrupts...
Retrieve field values using reflection.
An Annotation declaration consits of ...........followed by th...
Represents a word character:[a-zA-Z_0-9]
Create objects using prameterized constructors
Assign field values using reflection.
Matcher Class does not have any constructors.
The class which consists of methods that operate at the group level,...
This use to find out whether a specific thread is running or not.-1...
Java use primitive data types which are not part of the object...
Methods of this class allows to create, delete and rename files,...
The Class which defines methods for basic numeric operations are well...
This causes a Thread to wait for some other thread to release a...
Wait() method can only be invoked only from wthin the synchronised...
Annotations consist of names and have no value associated with it. It...
This Annotation should not be used on classes, interfaces, package, or...
This is used to negate one or more nested character classes1 choice.
This is matched with a character sequence string. This is called as...
Tries to match the input sequence against the pattern starting from...
This is a technique where all characters are matched except those...
Which of the following details are not retrieved when a class is...
The basic form of pattern matching supported by regex- 1 choice.
Create objects using default constructors?
Which statements are true ?- 3 choices
In a multithreading program two or more threads cannot run...
The UNION  is
Represents a non - whitespace character: [^\S]
Which are Metacharacters?- 3 choices
This is a way by which programmers can specify the byte of objects...
Which statements are true?- 3 choices
Which are not metacharacter?- 2  choices
A Constructor for the Double  wrapper class can be written ...
Occurs when a Thread is not a state to receive a  request...
The Class which subclass of all class.- 1 choice
Causes the current Thread to wait until the thread on which it is...
Which statements are true?- 3 choices.
Which statements are true?- 2 choices
Which statements are true?- 3 choices
Which statement are true?- 3 choices.
Which Statements are true?- 3 choices
Which Statement are true?-  3 choices
Which Types are not in Wrapper classes.- 2 choices
Which statements are true?- 3 choices.
Methods of DataInputStream are used to:- 2 choices.
Which statements are true?- 3 choices
Which Statement are true?- 3 choices.
Which statements are true?- 2 choices.
Which Statements are true?- 2 choices
Alert!

Advertisement