Hi Ankit,
class Fruit
{
public static void main(String[ ] args)
{
Fruit fruitTree = new Fruit( );
fruitTree.growFruit( );
}
void growFruit( )
{
String fruit1 = "apple";
String fruit2 = transform(fruit1); ----->while invoking this method fruit2 will contain "apple juice" and "orange".am i right?
System.out.print( fruit1+ " " +fruit2); ----->here, fruit1 has "apple".
}
String transform(String fruits)
{
fruits = fruits + " juice";
System.out.print(fruits + " ");
return "orange";
}
how come the "apple juice" comes first?
