0

Aoa... i m new to java.. please help me to correct this program given blew. it shows error of illegal start of esxpression.. how could b it seems as correct program please help me.. thanks alot

**error: illegal start of expression
JOptionPane.showMeassageDialog(null, "ID: " + ID + "name: " + name + "category:
" + category + "price: " + price + "quantity: " + quantity + "description: " + d
escription+);
**

import javax.swing.*;
class product
{
string ID;
string name;
srting category;
string price;
string quantity;
string description;

// Perameterized constructor
public product(string I, string n, string c, string p, string q, string d){
ID = I;
name = n;
category = c;
price = p;
quantity = q;
description = d;
}

// method for displaying product record on GUI

public void print( )
{
JOptionPane.showMeassageDialog(null, "ID: " + ID + "name: " + name + "category: " + category + "price: " + price + "quantity: " + quantity + "description: " + description+); 
}
}
3
Contributors
5
Replies
16
Views
3 Years
Discussion Span
Last Post by stultuske
0

it's String, not string or srting. you need to remove all the typo's from your code.

and showMessageDialog, not showMeassageDialog.

Edited by stultuske

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.