-
void type not allowed
void type not allowed here
System.out.println(sh.achat_Produit("xxx",120,10);
__________________________________________________ ______________
package shopping.client;
import javax.naming.InitialContext;
import shopping.bean.ShopRemote;
public class Client
{
public static void main(String[] args) throws Exception
{
InitialContext ctx = new InitialContext();
ShopRemote sh = (ShopRemote)ctx.lookup("ShopBean/remote");
}
}
__________________________________________________ ______________
import javax.ejb.Stateful;
import javax.ejb.Remote;
@Stateful
public void achat_Produit(String produit, double prix, int qte)
{
for (int nbp=0;nbp<tabProduit.length;i++)
{
tabProduit[nbp]=produit;
tabPrix[nbp]=prix;
tabQte[nbp]=qte;
nbp++;
}
}
-
no return value = the method print cant print anything :)
what output did you expect?
-
println() expects an object (or something anyway).
achat_Produit() has no return value, so cannot be returning an object.
That's your problem.
As eRaaaa asks, what is it you're trying to achieve?
-
-
If your question has been answered, please click on Thread Tools above and mark this question solved. Thank you.
Also, this is hardly an advanced Java question and so I'm moving this to the New to Java section.
-
-
where is the word solved !!!