CodeGym
Promotion
CodeGym University
Learning
Course
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme
Question
  • Reviews
  • About us
Start
Start learning
Start learning now
  • All questions
ANKIT KUMAR SHARMA
Level 1
Mumbai
  • 29.08.2018
  • 994views
  • 6comments

Code is not running

Question about the task Declare variables
Java Syntax,  Level 0,  Lesson 4
Under discussion


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".

Requirements:
  • Declare a String variable called name.
  • Declare an int variable called age.
  • Declare a String variable called city.
  • There should be 3 variables declared.
package com.codegym.task.task01.task0105; /* Declare variables */ public class Solution { public static void main(String[] args) { String a = "name"; int c = "age"; string b = "city"; System.out.println(a + c + b ); } }
0
Comments (6)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
naeem
Level 0
14 November 2018, 10:32
can anyone plz send the code of this task?
0
Usama Ali
Level 2 , Multan, Pakistan
10 September 2018, 11:30
What else explain this I am unable to perform
0
Roman
Level 41
30 August 2018, 07:56
name age and city are names of variables, not values of variables.
0
Muhammad Anas Khan
Level 0 , Topi, Pakistan
30 August 2018, 03:37
its not int c its String c and u write String b String s will be Capital not small
0
Thebe
Level 7 , Benares, India
29 August 2018, 14:43
it's String not string
0
Gaurav bhatt
Level 2 , Delhi, India
26 February 2019, 18:25
/* Declare variables */ public class Solution { public static void main(String[] args) { String name; int age; String city; } }
0
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Game Projects
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning and Java developer’s career.
Follow us
Interface language
Programmers Are Made, Not Born © 2023 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2023 CodeGym
This website uses cookies to provide you with personalized service. By using this website, you agree to our use of cookies. If you require more details, please read our Terms and Policy.