Beginner method call problem
Hi,
I need help to get the method below "createarticle" to call a a new method called "outprintarticlecreated()" in the same class. The new "outprintarticlecreated()" method should just print out with JOptionPane that a new article has been created. It should be easy, but I cant get it right and I tried with tutorials. Beginner problem.. Please help me someone!
Code Java:
public void createarticle(String artId, String name, int instock,
double price) {
Register.artikelRegister.put(artId, new Artikel(artId, name,
instock, price));
}
outprintarticlecreated();
JOptionPane.showMessageDialog(null, "Article created!")
Re: Beginner method call problem
It looks like you're code is missing some syntax sugar:
the method call to outprintarticlecreated() should be inside of the createarticle method (suggestion: use the camel case naming convention)
You also need to define outprintarticlecreated (see the signature of createarticle for how to do this).
Re: Beginner method call problem
Solved...so easy. Thanks!