
Why u dont understand sir?? I want to make a table program which generate a table on showMessageDialog. I have learnt these methods until now. import.javax.swiing JOptionpane Integer.parseInt() public static void main(String arg[]). I want to make program which use these above methods. No other methods to be used. Write a table program which use only and only these above methods. No Buffer,append, BufferString() methods use. pl understand my problem sir.

Hi Friend,
Check it:
import javax.swing.*;
import java.io.*;
class CreateTable{
public static void main(String[] args)throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter number: ");
int n=Integer.parseInt(br.readLine());
String st="";
int result;
for(int a = 1; a <= 10; a++){
result = n * a;
st+=n+" * "+a+" = "+result+"\n";
}
JOptionPane.showMessageDialog(null,st);
}
}
Thanks

Hi,
If you do not want to input number from user then try this:
import javax.swing.*;
class CreateTable{
public static void main(String[] args)throws Exception{
String st="";
int n=5;
int result;
for(int a = 1; a <= 10; a++){
result = n * a;
st+=n+" * "+a+" = "+result+"\n";
}
JOptionPane.showMessageDialog(null,st);
}
}
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.