Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

In method overloading ,if i change the return type to Long
instead of INT,is the program execute

Answer Posted / umanath

Write a following program:

class OverloadDemo {
int test(int x) {
return x*x;
}

int test(long a) {
long l = a*a*a;
return l;
}

double test(double a) {
return a*a;
}

}

Compile that program:

C:\>javac OverloadDemo.java
OverloadDemo.java:9: possible loss of precision
found : long
required: int
return l;

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is early binding and late binding in java?

1099


What is run time allocation?

975


How to read and write image from a file ?

994


Can we make the abstract methods static in java?

995


What are the differences between heap and stack memory in java?

997


Can we use string in switch case in java?

997


Can you make a constructor final?

978


Explain the differences between static and dynamic variables?

1082


placement papaers of spring computing technology

1361


What is the base class in java from which all classes are derived?

920


How to sort numbers in java without array?

926


What is == and === in javascript?

992


How do you check whether the list is empty or not in java?

921


What is lambda programming?

940


What are the types of sockets in java?

1055