Computer Applications
Distinguish between parseFloat() and parseDouble()
Java Library Classes
1 Like
Answer
| parseFloat() | parseDouble() |
|---|---|
| parseFloat() method returns a float value represented by the specified string. | parseDouble() method returns a double value represented by the specified string. |
Answered By
1 Like
Related Questions
Distinguish between isUpperCase() and toUpperCase()
Distinguish between isDigit() and isLetter()
Define a class (using the Scanner class) to generate a pattern of a word in the form of a triangle or in the form of an inverted triangle, depending upon user's choice.
Sample Input:
Enter a word: CLASS Enter your choice: 1 Sample Output: C CL CLA CLAS CLASS Enter your choice: 2 Sample Output: CLASS CLAS CLA CL CDefine a class called mobike with the following description:
Instance variables/Data members:
int bno - to store the bike's number
int phno - to store the phone number of the customer
String name - to store the name of the customer
int days - to store the number of days the bike is taken on rent
int charge - to calculate and store the rental chargeMember Methods:
void input() - to input and store the details of the customer
void compute() - to compute the rental chargeThe rent for a mobike is charged on the following basis:
First five days Rs 500 per day;
Next five days Rs 400 per day;
Rest of the days Rs 200 per day.void display () - to display the details in the following format:
Bike No. Phone No. No. of days Charge