0% found this document useful (0 votes)
56 views

Void Mult: T1 Obj New T1 Obj. Mult (Message)

The document contains multiple versions of a Java class called T1 that defines a static method called mult() to print out the multiplication table of a given integer. The mult() method takes an integer parameter m, prints an introductory message, and uses a for loop to print out m multiplied by each integer from 1 to 12. The main method gets user input, calls the mult() method, and passes the input value.

Uploaded by

al_badwi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views

Void Mult: T1 Obj New T1 Obj. Mult (Message)

The document contains multiple versions of a Java class called T1 that defines a static method called mult() to print out the multiplication table of a given integer. The mult() method takes an integer parameter m, prints an introductory message, and uses a for loop to print out m multiplied by each integer from 1 to 12. The main method gets user input, calls the mult() method, and passes the input value.

Uploaded by

al_badwi
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.util.Scanner; public class T1{ void mult(int m) {System.out.println ("The multiplication ..

\n" ); for(int x=1; x<= 12; x++) System.out.println (m + " * " + x + " = " + m * x);} public static void main (String[] args) { Scanner scan = new Scanner (System.in); int message = scan.nextInt();

T1 obj = new T1(); obj. mult(message);


} } public class T1{

static void mult(int m)

{ System.out.println ("The multiplication .. \n" ); for(int x=1; x<= 12; x++) System.out.println (m + " * " + x + " = " + m * x);} public static void main (String[] args) { Scanner scan = new Scanner (System.in); int message = scan.nextInt();

mult(message);

public class T1{

int x;
static void mult(int m) { System.out.println ("The multiplication .. \n" + x ); for(x=1; x<= 12; x++) System.out.println (m + " * " + x + " = " + m * x); } public static void main (String[] args) { Scanner scan = new Scanner (System.in); int message = scan.nextInt(); mult(message); } } public class T1{

static int x;

static void mult(int m) { System.out.println ("The multiplication .. \n" + x ); for(x=1; x<= 12; x++) System.out.println (m + " * " + x + " = " + m * x); } public static void main (String[] args) { Scanner scan = new Scanner (System.in); System.out.println (" Enter a line of text: " int message = scan.nextInt(); mult(message); } }

+ x);

You might also like