how to write Java program description list
Answers
Answered by
0
public class Hello
{
/* Author: www.w3schools.in
Date: 2018-04-28
Description:
Writes the words "Hello Java" on the screen */
public static void main(String[] args)
{
System.out.println("Hello Java");
}
}
Answered by
1
class Factorial
{
public static void main(String args[])
{
int fact=1;
for(int i=1;i<=5;i++)
{
fact=fact*i;
}
System.out.println("Factorial of 5 is"+fact);
}
}
Variable Name Variable Type Purpose
- Args String[] To accept command line arguments.
- i int To iterate the for-loop for calculation.
- fact int To store the value of the factorial.
Similar questions
Math,
6 months ago
History,
6 months ago
Math,
6 months ago
Psychology,
11 months ago
Math,
11 months ago