Declare variables

  • 1
  • Locked
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".
You can't complete this task, because you're not signed in.
Comments (11)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Allan Gilbert
Level 2 , Нью Йорк, India
23 March, 15:56
String name; int age; String city;
Lord
Level 1 , Germany
15 January, 14:12
Hi :)
Abdisa Jillo
Level 2 , United States of America, United States
27 December 2022, 04:23
String name ; int age ; string city;
Anonymous #11145782
Level 2 , Gurgaon, India
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); } }
San Shein
Level 3 , Thailand
16 July 2022, 16:17
The comment line /* Declare variable */ should be inside the main method.
Roman
Level 41
18 July 2022, 05:32
No, it shouldn't.
Anonymous #10935974
Level 2 , Saudi Arabia
2 March 2022, 22:00
I added numper to the variable age and run give me true
javist Android Developer
24 February 2022, 17:35
code entry the best for practice
SivaHack
Level 1
17 February 2022, 02:41
//your choice 🤪 String name ="SIVAHACKER";//your name int age= 22;//your age String city="India";//your city name
IRFAN BAIG
Level 9 , India, India
16 February 2022, 10:49
String name; int age; String city;
Vusal Mammadov
Level 2 , United States of America, United States
13 February 2022, 04:14
String name, city; int age;