write a program in java for a grocery (fruit shop calculate the prize of bananas @ $.89/kg declaring the the prices of all either as instances or class variables.declare the weight of the fruit as local variables

Sure! Here's an example of how you can write a Java program to calculate the price of bananas in a grocery shop:

```java
public class GroceryShop {
// price of bananas per kilogram
private static double bananaPricePerKg = 0.89;

public static void main(String[] args) {
// weight of the bananas in kilograms
double bananaWeight = 2.5;

// calculate the total price of the bananas
double totalPrice = bananaPricePerKg * bananaWeight;

// display the total price
System.out.println("Total price of bananas: $" + totalPrice);
}
}
```

In this program, we declare the price of bananas as a class variable (`bananaPricePerKg`) because it is the same for all bananas sold in the shop. We then declare the weight of the bananas as a local variable (`bananaWeight`) because it can vary for each purchase.

To calculate the total price, we simply multiply the banana price per kilogram (`bananaPricePerKg`) by the weight of the bananas (`bananaWeight`). The result is stored in the `totalPrice` variable.

Finally, we display the total price using the `System.out.println()` method.

You can run this code in a Java development environment, such as IntelliJ IDEA or Eclipse, to see the output.