December 2015
Beginner
698 pages
15h 16m
English
doSomething(){
// Do something here
}No return type is declared. You do not have to return a value from a method, but its return type must be void in this case. This is how the method should look:
void doSomething(){
// Do something here
}float getBalance(){
String customerName = "Linus Torvalds";
float balance = 429.66f;
return customerName;
}The method returns a String (userName) variable, but the signature states that it must return a float. With a method name like getBalance, this code is probably what was intended:
float getBalance(){
String customerName = "Linus Torvalds";
float balance = 429.66f;
return balance;
}onCreate method? !Trick ...Read now
Unlock full access