Home Tuitions

MCQ Based questions for CUET Information practice (IP) Chapter 12 More about classes and libraries

Board CBSE
Textbook NCERT
Class Class 12
Subject Informative Practices (IP)
Chapter MCQ Based questions for CUET Information practice (IP) Chapter 12 More about classes and libraries
Chapter Name Chapter 12 More about classes and libraries
Category CUET (Common University Entrance Test) UG

Practice MCQ Based questions for CUET Information practice (IP) Chapter 12 More about classes and libraries

This page is created by HT experts and consists of MCQ-based questions with detailed explanations for CUET Information practice (IP) Chapter 12 More about classes and libraries. All the important concepts of Chapter 12 More about classes and libraries for the CUET entrance exam are covered by MCQ questions with detailed explanations. Do solve chapter-wise MCQ questions for CUET Computer Science and CUET IP prepared by experts. 

MCQ Based questions for CUET Information practice (IP) Chapter 12 More about classes and libraries Set-A

Informatics Practices - MCQ on MORE ABOUT CLASSES AND LIBRARIES

Class XII

Q.1. Group of logically related classes in java is known as

a. Class.

b. Tool.

c. Package.

d. Object.

Answer:

(c)

Explanation : A package is a group of logically related classes which make the feature of reusability easier to accomplish. It is like a container for classes and can be accessed in any program.

Q.2. Methods used to obtain information about an object are known as

a. Access methods.

b. Accessor methods.

c. User defined methods.

d. System methods.

Answer:

(b)

Explanation : Accessor methods are the methods used to obtain information about an object. The String class provides various accessor methods that may be used to perform operations on strings. Some Accessor methods are capacity(),charAt(), compareTo(), concat() etc.

Q.3. To control the access to fields and methods of a class in java, we can use

a. Access Modifier.

b. Class and Object.

c. Access Specifier.

d. Accessibility.

Answer:

(c)

Explanation : Access Specifier determines which feature of a class (the class itself, data members ,member functions) may be used by other class. It controls the access to methods and fields. There are four types of access specifier in java – Public, protected, private and default.

Q.4. The concept of OOPs through which properties of a class can get accessed in another class is

a. Encapsulation.

b. Abstraction.

c. Polymorphism.

d. Inheritance.

Answer:

(d)

Explanation : In inheritance, a class can inherit the properties from another class. The inheriting class is a subclass or derived class and the class being inherited is a superclass or base class.

Q.5. In java, the class variables and methods are always declared with the

a. instance keyword.

b. public keyword.

c. volatile keyword.

d. static keyword.

Answer:

(d)

Explanation : The methods and fields of a class declared with static are also known as class fields and class methods. Static members belong to a class as a whole and not to a particular instance (object).

Q.6. Set of readymade software routines or class definitions is known as

a. Routine.

b. User defined class.

c. Library.

d. Class.

Answer:

(c)

Explanation : A set of readymade software routines (class definitions) that can be reused in new program is called a Library. Java offers many libraries that the programmers can use as per their needs. There are numerous java libraries pertaining to different functions such as user interface libraries, XML libraries, database connectivity libraries and many others.

Q.7. The Library which is by default imported to the java program

a. Java.lang.

b. Java.io.

c. Java.util.

d. Java.Math.

Answer:

(a)

Explanation : “java.lang” contain language support classes. These classes are used by java compiler itself; therefore, they are automatically or by default imported into the program of java.

Q.8. The class which hold mutable strings is

a. Character class.

b. MutableString class

c. String class.

d. StringBuffer class.

Answer:

(d)

Explanation : Instances or objects of StringBuffer class can hold mutable strings that can be changed or modified.

Q.9. The class which holds a single character is

a. SingleCharacter class.

b. String class.

c. Character class.

d. StringBuffer class.

Answer:

(c)

Explanation : The instances or objects of a character can hold single character data. This class offers many methods to manipulate or inspect single-character data.

Q.10. To access a package we need to use

a. Using statement.

b. Package statement.

c. Import statement.

d. Access statement.

Answer:

(c)

Explanation : Libraries are generally imported or used in a program by using IMPORT statement.

To import java’s IO (java.io) library, you will write:

import java.io.*

Q.11. Math library is available in

a. Java.lang.

b. Java.util.

c. Java.net.

d. Java.awt.

Answer:

(a)

Explanation : To perform mathematical computation in the program, java has provided MATH library which contains a set of useful mathematical functions and constants. Math library is available in “java.util” package. To use Math library you need to import “java.util” package.

Q.12. To compute something in the form of ab where a and b are numbers, we can use

a. round() method.

b. pow() method.

c. multiply() method.

d. divide() method.

Answer:

(b)

Explanation : To compute something in the form ab where a and b are numbers, we can use pow() method of MATH library.

Syntax:

pow (double a , double b)

It returns the first argument (a here) raised to the power of the second argument (b here), i.e., ab.

Q.13. All input and output related classes are a part of

a. java.util.

b. java.io.

c. java.lang.io.

d. java.awt.

Answer:

(b)

Explanation : All input and output related classes are part of “java.io” package. Here “io” stands for Input/Output.

Q.14. The superclass of all the classes in java is

a. Class.

b. Base.

c. Object.

d. Java.

Answer:

(c)

Explanation : As an object oriented language each and everything in java is considered as an object. Every class has an Object as a superclass.

Q.15. Calendar class is the part of

a. Java.util package.

b. Java.io package.

c. Java.lang package.

d. Java.net package.

Answer:

(a)

Explanation : Calendar class is the part of “java.util” package. This class is an abstract class whose object is created with the help of following method:

Static calendar getInstance();

Calendar Calcurrent = Calendar.getInstance();

These statements create a Calendar object namely Calcurrent

Q.16. In java, all strings are

a. Classes.

b. Files.

c. Packages.

d. Objects.

Answer:

(d)

Explanation : Java is an object oriented language. Strings are also handled as objects and one advantage of it is that a string object has a great variety of methods that we can use with it.

Q.17. The immutable strings are available in

a. String class.

b. StringBuffer class.

c. Character class.

d. ImmutableString class.

Answer:

(a)

Explanation : The String class object can hold unchanging(immutable) string, i.e., once initialized its contents cannot be modified.

Q.18. To bind fields and methods into a single unit, we use

a) library.

b) package.

c) variables.

d) class.

Answer:

(d)

Explanation : In object oriented language, classes are used to bind methods and variables in one single unit.

Q.19. The term that refers to the process that set specified path of a user defined package is

a. classpath.

b. language.

c. address.

d. protocol.

Answer:

(a)

Explanation : The CLASSPATH is an environment variable that tells the Java compiler where to find the compiled bytecode files. The CLASSPATH is either defined for the file you create and the one required by the system that comes with the JDK itself. So, we always need to set the classpath.

Q.20. The default access specifier of class members is

a. Private.

b. Public.

c. Protected.

d. Default.

Answer:

(d)

Explanation : If no access specifier is used, then the class member has default access, i.e., known as default access specifier. Members with default access are available to all classes in the same package, but are not available to any classes in other packages, even subclasses. It is also termed as friendly or package access.

Q.21. Which command create a package in java?

a. Package.

b. Create.

c. Run.

d. Library.

Answer:

(a)

Exp: To create user defined package we need to declare the name of the package followed by the package keyword at the beginning of a file using the form:

Package World;

//World is the name of the package.

Q.22. The other name for default access specifier is

a. friendly.

b. protected.

c. public.

d. library.

Ans. a.

Explanation : If no access specifier is used, then the class member has default access, i.e., known as default access specifier. Members with default access are available to all classes in the same package, but are not available to any classes in other packages, even subclasses. It is also termed as friendly or package access.

Q.23. A class enforces information hiding through

a. Inheritance.

b. Access specifier.

c. Access Modifier.

d. Classes and Objects.

Answer:

(b)

Explanation : Inheritance is the property through which we can control the access to the class members, i.e., fields as well as methods. So, it is helpful in enforcing information hiding.

Q.24. The class used to show specific instant of time is

a. Calendar.

b. Date.

c. Time.

d. Current.

Answer:

(b)

Explanation : Date class is used to show the specific instant of time. This class is available in “java.util” package so to use it we need to import “java.util.Date” package using import statement.

Q.25. Calendar class is an

a. Abstract class.

b. Base class.

c. Aviator class.

d. Anonymous class.

Answer:

(a)

Explanation : Calendar is an abstract base class for converting between a Date object and a set of integer fields such as YEAR, MONTH, DAY, HOUR and so on.

Q.26. To create an object of calendar class we need to use

a. Accessor method.

b. getInstance() method.

c. get() method.

d. Set() method.

Answer:

(b)

Explanation : To create a java.util.Calendar object, you have to use its static getInstance method:

Static Calendar getInstance( );

Calendar calCurrent =Calendar.getInstance( );

Above statements create a Calendar object namely calCurrent.

Q.27. The obtain the values in a calendar object, we use

a. value() method

b. insert() method

c. get() method

d. set() method

Answer:

(c)

Explanation: The Calendar object can set/get values for day, month, year, hour, minute, second, day of the week etc using one of the following two overloaded method:

set(int field, int value);

get(int field);

get() method is used to obtain value of specific field.

Q.28. The collection of networking related classes are available in

a. java.lang package.

b. Java.util package.

c. Java.net package.

d. Java.io package.

Answer:

(c)

Explanation: The networking related classes are defined in “java.net” package. So to use these classes we have to use “import” statement as follows:

import java.net.*;

Q.29. In java, the two types of packages are

a. Utility packages and API packages.

b. Web based package and Application based package.

c. Java API package and User defined package.

d. System defined package and User defined package.

Answer:

(c)

Explanation : There are two types of package available in java:

a) Java API package

b) User-defined package

Java API (Application Programming Interface) package provides a large number of classes grouped into different packages according to functionality. It is system defined package whereas user defined packages are created by users.

Q.30. If we do not want to insert a number in pow() method then we can use

a. None

b. NULL

c. NaN

d. Not Available

Answer:

(c)

Explanation : NaN is a way to express Not-A-Number in java. If any argument is not a number, i.e., NaN6, then the result is a NaN.

CUET Information practice (IP) Chapter 12 More about classes and libraries Set-B

Q.31. If we use setLength() method to specify a length shorter than its string, the string is

a. appended.

b. truncated.

c. modified.

d. updated.

Answer:

(b)

Explanation : If we use setLength() method to specify a length shorter than its String, then the string is truncated.

Q.32. pow() and round() methods are available in

a. Java.util package.

b. Java.io package.

c. Java.lang.Math package.

d. Java.awt package.

Answer:

(c)

Explanation: pow() and round() methods are defined in Math class which is the part of java.lang package. pow() method is used to find the power of number in the form ab and round() method round off a number to its nearest integer.

Q.33. The class member that is accessible everywhere in the program is

a. protected.

b. private.

c. default.

d. public.

Answer:

(d)

Explanation : The public members are visible to the entire class in which it is defined. Public access Specifier Specify that all the methods and variable are directly accessible from all other classes.

Q.34. The objects of StringBuffer class can be

a. deleted.

b. detected.

c. forwarded.

d. modified.

Answer:

(d)

Explanation : StringBuffer class is that class whose instances or objects can hold mutable strings that can be changed or modified.

Q.35. The StringBuffer methods allow

a. Modification of calls of methods.

b. Appending of calls of methods.

c. Chaining of calls of methods.

d. Deletion of calls of methods.

Answer:

(c)

Explanation : Some StringBuffer methods return a StringBuffer value like append(), insert() etc. They return the same StringBuffer that was used in the call. This allows chaining of calls.

For example

sb.append(“x= “).append(x).append(“,y=“). append(y);

If x is 5 and y is 2, the above code will give result as x=5,y=2

Q.36. The method that returns the total number of characters in the string is

a. capacity().

b. length().

c. setLength().

d. append().

Answer:

(b)

Explanation : The length() method is an accessor method of String class which returns the length of the current string.

The prototype of length() method is

int length();

Q.37. The StringBuffer object is more flexible than

a. class object.

b. io object.

c. Character object.

d. String object.

Answer:

(d)

Explanation : The StringBuffer object is more flexible in compare to string object. Stringbuffer object holds mutable string that can be changed or modified whereas a string class object hold immutable string that is of fixed length and cannot be changed.

Q.38. The method that returns the character at the specified length is

a. characterAt().

b. charAt().

c. lengthAt().

d. valueAt().

Answer:

(b)

Explanation : the prototype of charAt() method is

char charAt(int index)

It returns the character at the specified index.

Q.39. Protected members can be accessed from within classes belonging to the same

a. system.

b. package.

c. class.

d. method.

Answer:

(b)

Explanation : Protected members can be accessed from within classes belonging to the same package to which the class of protected members belongs.

Q.40. The function of the dot(.) operator is

a. Enable you to access the instance variables of any object within a class.

b. Enable you to store values in instance variables of an object.

c. Used to call object methods.

d. Used to create a new object.

Answer:

(c)

Explanation : The dot(.) operator is used to call object methods as follow

Classname obj = new classname();

Obj.method1();

Where obj is the object of classname and method1 is the methods of classname. This method is accessed by using dot(.) operator with the object.

Q.41. StringBuffer object is always created with the use of

a. “new” operator.

b. “+”operator.

c. “create” operator.

d. “instantiate” operator.

Answer:

(a)

Explanation : In java“new” operator causes -

Ø a new instance of the given class is created

Ø memory is allocated for it

Ø a constructor is called

A StringBuffer object is always created with the use of new operator as follows:

StringBuffer sf = new StringBuffer;

This method creates an empty stringBuffer object namely sf.

Q.42. A class is a collection of methods and

a. fields.

b. main() method.

c. keywords.

d. interfaces.

Answer:

(a)

Explanation : A class is a collection of methods and fields. It binds variables and functions together.

43. Java is a

a. case-sensitive language.

b. procedural language.

c. non-case-sensitive.

d. structured language.

Answer:

(a)

Explanation : Java is a case – sensitive language where capital letter and small letter differ from each other.

Q.44. The compareTo() method compares two strings

a. linearly.

b. geometrically.

c. lexicographically.

d. geographically.

Answer:

(c)

Explanation : The compareTo() method compares two strings lexicographically. Lexicography is the way dictionaries are written, i.e., alphabetical order to words.

The prototype of compareTo() method is:

int compareTo(String1, anotherString)

Q.45. Lexicography is the way of writing words in

a. non-alphabetical order.

b. small letter.

c. alphabetical order.

d. capital letter.

Answer:

(c)

Explanation : Lexicography is the way dictionaries are written, i.e., alphabetical order to words. The compareTo() method compares two strings lexicographically.

Q.46. Character class is a

a. Wrapper class.

b. Inherited class.

c. Package of classes.

d. Library of methods.

Answer:

(a)

Explanation : Character class is a wrapper class where instances or objects can hold single character data. This class offers many methods to manipulate or inspect single – character data.

Q.47. For creating an object, it is mandatory to use “new” operator in

a. StringBuffer class.

b. String class.

c. Object class.

d. Character class.

Answer:

(a)

Explanation : A StringBuffer object is always created with the use of new operator as follows:

StringBuffer sf = new StringBuffer;

This method creates an empty stringBuffer object namely sf.

Q.48. The class member that restricts accessibility in subclasses

a. public.

b. protected.

c. private.

d. default.

Answer:

(c)

Explanation : Private access specifier provides highest degree of protection. Private methods and fields can only be accessed within the same class to which the methods and fields belong. It restricts accessibility in subclasses.

Q.49. To concatenate two strings, we can use

a. capacity() method.

b. charAt() method.

c. valueOf() method.

d. Concat() method.

Answer:

(d)

Explanation : To concatenate two strings, we can use concat() method.

The prototype of concat() method is

String concat(String str)

It concatenates the specified string to the end of this string(current String object) string.

Q.50. The method used to calculate absolute value of a number

a. abs() method.

b. absolute() method.

c. value() method.

d. floor() method.

Answer:

(a)

Explanation : abs() method is used to find out the absolute value of a number. To use abs() method we need to use Math library as follows:

Math.abs(-7)

It will yield the result as 7.

Q.51. The keyword used to represent current string is

a. that.

b. object.

c. current.

d. this.

Answer:

(d)

Explanation : “this” is the keyword used to represent current string. This is useful when you need to refer to instance of the class from its method. The keyword helps us to avoid name conflicts.

Q.52. The method that is used to remove white spaces from both ends of the string is

a. truncate().

b. remove().

c. trim().

d. hide().

Answer:

(c)

Explanation : “trim()” is the method of String class that removes white spaces from both ends of the current string.

The prototype of trim() method is

String trim()

Q.53. To return a new string from the current string we can use

a. “+” operator.

b. substring() method.

c. Trim() method.

d. “-” operator.

Answer:

(b)

Explanation : Other than the concat() method, we can use “+” operator to concatenate two strings.

We can use “+” operator in this way as

str1 + str2

It returns the concatenated string as “str1str2”.

Q.54. The operator that is alternative to concat() method is

a. “/” operator.

b. “-” operator.

c. “+” operator.

d. “\” operator.

Answer:

(c)

Explanation : Other than the “concat()” method we can use “+” operator to concatenate two strings.

We can use “+” operator in this way as

str1 + str2

It returns the concatenated string as “str1str2”.

Q.55. A string object encapsulates sequence of

a. operators.

b. methods.

c. texts.

d. characters.

Answer:

(d)

Explanation : In java, we can work with single character as well as with “group of characters”. This group of character is encapsulated by a String object.

Q.56. The method that compares strings while ignoring case is

a. compareTo().

b. equalsIgnoreCase().

c. compareIgnoreCase().

d. equalsCompareCase().

Answer:

(b)

Explanation : The prototype of equalsIgnoreCase() method is

Boolean equalsIgnoreCase(String str)

It compares this string (current String object) to the specified object str, ignoring case consideration.

Q.57. A StringBuffer object contains a memory block called

a. Memory.

b. Buffer.

c. Cache.

d. Block.

Answer:

(b)

Explanation: StringBuffer object instances or object hold mutable strings that can be changed or modified. So, it always holds a block of memory called “buffer”. The length of the string may not be the same as the length of the buffer.

Q.58. When the StringBuffer object’s length is longer than the String it holds, the extra character contains

a. ’\u0000’.

b. ’\f0000’.

c. ’\a0000’.

d. ’\g0000’.

Answer:

(a)

Explanation : The length of the string may not be the same as the length of the buffer. When the StringBuffer object’s length is longer than the String it holds, the extra character contain “\u0000”.

Q.59. You can change the length of a string in a StringBuffer object with the

a. get() method.

b. length() method.

c. set() method.

d. setLength() method.

Answer:

(d)

Explanation : You can change the length of a string in a StringBuffer object with the setLength() method.

The prototype of setLength() method is

setLength(n)

Sets the length of the content to n by either truncating current content or extending it with the null character (‘\u0000’). Use sb.setLength(0; to clear a string buffer.

Q.60. StringBuffer sf = new StringBuffer;

This method creates a “sf” string object of

a. full length.

b. empty length.

c. null length.

d. full capacity.

Answer:

(b)

Explanation : StringBuffer objects are always created with new operator.

StringBuffer sf = new StringBuffer;

This method creates an empty stringBuffer object namely sf.

Q.61. In StringBuffer class “append()” and “insert()” methods are overloaded and will call the

a. toChar() method for all objects.

b. String() method for all objects.

c. StringBuffer() method for all objects.

d. toString() method for all objects.

Answer:

(d)

Explanation : In append() and insert() method, parameter may be of any type. These methods are overloaded and will call the toString() method for all objects.

Q.62. Math.round(-1.5 will yield the result as an E-mail application is a type of

a. 1.

b. -2.

c. -1

d. 1.5.

Ans : c.

Explanation : “round()” method add 0.5 to the argument and returns the closest integer/long value

Math.round(-1.5)

will yield the result as -1

Q.63. Math.round(Float.NaN) will return

a. 0.

b. 1.

c. Null.

d. 1.0.

Answer:

(a)

Explanation : If the argument is not a number in round() methods it will return ZERO.

Math.round(Float.NaN)

will return zero(0)

Q.64. In round() method, if the argument is a negative infinity or less than the MIN_VALUE for the type, then it will return the MIN_VALUE of the

a. Parameter.

b. Return type.

c. Data type.

d. Argument.

Answer:

(b)

Explanation : If the argument is a negative infinity or less than the MIN_VALUE for the type, then it will return the MIN_VALUE of the return type

Math.round(Float.NEGATIVE_INFINITY)

will return -2147483648

-2147483648 is the minimum value of the integer data type in java.

Q.65. In Java, API stands for

a. ApplicationPackage Interface.

b. Applied Programming Interface.

c. Application Programming Interface.

d. All package Interface.

Answer:

(c)

Explanation : API stands for Application Programming Interface. Java API is the collection of system packages that we can import in our java program.

Q.66. Two classes in two different packages can have the same

a. path.

b. name.

c. classpath.

d. object.

Answer:

(b)

Explanation : Two classes in two different packages can have the same name. In packages, classes can be unique compared with classes in other packages, i.e., two classes in two different packages can have the same name.

Q.67. A package acts as a

a. Container for classes.

b. Methods for classes.

c. Objects for classes.

d. Collector for classes.

Answer:

(a)

Explanation : Packages are java’s way of grouping a variety of classes and/or interfaces together. It act as ”containers” for classes.

Q.68. Math.round(Float.POSITIVE_INFINITY)

will return

a. 9223372036854775807

b. -2147483648 .

c. 2147483648.

d. -9223372036854775807

Answer:

(a)

Explanation : If the argument is a positive infinity or greater than the MAX_VALUE for the type, then it will return the MAX_VALUE of the return type.

Math.round(Float.POSITIVE_INFINITY)

will return 9223372036854775807

9223372036854775807 is the maximum value of the long data type in java.

Q.69. The packages are always organized in

a. linear structure.

b. horizontal structure.

c. hybrid structure.

d. hierarchical structure.

Answer:

(d)

Explanation : The packages are organized in a hierarchical structure. The package named java contains the package awt, which in turn contains various classes required for implementing graphical user interface.

Q.70. The defined classes in a user defined package need to be declared with

a. private access specifier.

b. protected access specifier.

c. public access specifier.

d. default access specifier.

Answer:

(c)

Explanation : The defined classes in a user defined package need to be declared with public access specifier. It is always created to get used in other programs so we need to declare the classes with public access-specifier.

Q.71. If we compile a file of a user defined package, it will create

a. “.class” file.

b. “.exe” file.

c. “.doc” file.

d. “.obj” file.

Answer:

(a)

Explanation : If we compile a file of a user defined package, it will create a “.class” file.

Q.72. The class used to convert Date to integer field is

a. Convert class.

b. Util class.

c. Date class.

d. Calendar class.

Answer:

(d)

Explanation : java.util.Calendar class is used to Convert a Date field to integer field. Calendar is an abstract base class for converting between a Date object and a set of integer fields such as YEAR, MONTH, DAY, HOUR and so on.

Q.73. The Date class represents a date object in

a. long integer format.

b. float format.

c. short integer format.

d. long float format.

Answer:

(a)

Explanation : java.util.Date class is used to represents a date objects in a long integer format. A Date object represents a specific instant in time.

Q.74. In calendar, class getInstance() method is

a. Abstract method.

b. Static method.

c. Public method.

d. Instance method.

Answer:

(b)

Explanation : To create a java.util.Calendar object, you have to use its static getInstance method as follows:

Static Calendar getInstance( );

Calendar calCurrent =Calendar.getInstance( );

These statements create a Calendar object namely calCurrent

Q.75. Calendar.Date field stores numeric

a) date.

b) year.

c) month.

d) day.

Answer:

(d)

Explanation : The Calendar class provides some static int fields.

Calendar.DATE field is used to store numeric date.

Q.76. The public members of objects are accessed through

a. “#” operator.

b. “.” operator.

c. “+” operator.

d. “à” operator.

Answer:

(b)

Explanation : The public members are accessed through dot(.) operator as follows

Obj.mathodname();

Obj is an object used to access a method, i.e., methodname.

Q.77. The method that returns the maximum number of characters that can be inserted in the string is

a. capacity().

b. length().

c. setLength().

d. maxString().

Answer:

(a)

Explanation : “capacity()” is an accessor method of String class that returns the maximum number of characters that can be entered in the current string object. The prototype of capacity() method is

int capacity();

Q.78. Math.round(Float.MAX_VALUE) statement returns

a. 0.

b. -2147483648.

c. Null.

d. 2147483648.

Answer:

(d)

Explanation : If the argument passed is Float.MAX_VALUE, the round() method returns integer.MAX_VALUE.

Math.round(Float.MAX_VALUE)

will return 2147483648

2147483648 is the maximum value of the integer data type in java.

Q.79. The method of the String class is

a. delete().

b. append().

c. reverse().

d. replace().

Answer:

(d)

Explanation : “replace()”is the method of string class whereas the other three methods are of StringBuffer class.

The prototype of replace() method is

String replace(char oidChar, char newChar)

It returns a new string resulting from replacing all occurrences of “oldChar” in the current string with the “newChar”.

Q.80. The declaration of a method is also known as

a. Description.

b. Initializing.

c. Prototype.

d. Definition.

Answer:

(c)

Explanation : The declaration of a method is also known as Method Prototype. The syntax of method declaration is as follows:

Return-type Method-name (Parameter list)

{

//Body of the method;

}