Write a program that declares the following variables in the main method:
String name, int age, and String city.
Note: "Declaring a variable" is the same thing as "creating a variable".
Declare variables
- 1
Locked
Comments (11)
- Popular
- New
- Old
You must be signed in to leave a comment
Allan Gilbert
23 March, 15:56
String name;
int age;
String city;
0
Lord
15 January, 14:12
Hi :)
0
Abdisa Jillo
27 December 2022, 04:23
String name ;
int age ;
string city;
0
Anonymous #11145782
2 November 2022, 12:15
public class Solution {
public static void main(String[] args) {
//write your code here
int y=3126;
System.out.println(y-8);
}
}
+1
San Shein
16 July 2022, 16:17
The comment line /* Declare variable */ should be inside the main method.
0
Roman
18 July 2022, 05:32
No, it shouldn't.
0
Anonymous #10935974
2 March 2022, 22:00
I added numper to the variable age and run give me true
0
javist Android Developer
24 February 2022, 17:35
code entry the best for practice
0
SivaHack
17 February 2022, 02:41
//your choice 🤪
String name ="SIVAHACKER";//your name
int age= 22;//your age
String city="India";//your city name
0
IRFAN BAIG
16 February 2022, 10:49
String name;
int age;
String city;
+2
Vusal Mammadov
13 February 2022, 04:14
String name, city;
int age;
0