Computer Applications
What is the type of parameter to be given for the method parseInt()?
- double
- String
- char
- int
Java Library Classes
3 Likes
Answer
String
Reason — The method Integer.parseInt() is used to convert a numeric value given in String form into an integer. Therefore, it requires a String parameter as input, not double, char, or int.
Answered By
2 Likes
Related Questions
In a calculator which Java feature allows multiple methods named calculate() for the different operations?
- abstraction
- inheritance
- encapsulation
- polymorphism
Assertion (A): The result of the Java expression 3 + 7/2 is 6.
Reason (R): According to the hierarchy of operators in Java, addition is done first followed by division.
- (A) is true and (R) is false.
- (A) is false and (R) is true.
- Both (A) and (R) are true and (R) is a correct explanation of (A).
- Both (A) and (R) are true and (R) is not a correct explanation of (A).
To extract the word NOW from the word "ACKNOWLEDGEMENT", the Java statement
"ACKNOWLEDGEMENT".substring(3, ...............)is used.Choose the correct number to fill in the blank.
- 6
- 7
- 5
- 8
The output of the below statement is:
String a[] = {"Atasi", "Aditi", "Anant", "Amit", "Ahana"}; System.out.println(a[1].charAt(1) + "*" + a[2].charAt(2));- da
- d*a
- ti
- t*i