I dont get 2/12


Replace this line with your code.


What is it exactly that you don't get?

Could you provide us with all the code in question as well?


public class DataTypes {
public static void main(String[] args) {
int a=7;

	System.out.println("int a");


Type any whole number in between the parentheses of System.out.println();

int data types do not need to be typed within quotes, so you can avoid using quotes this time

the code and question is given please give the necessary answer



System.out.println("int a");

Is the issue here.

If you would like to print the value of a variable - in this case it's a - you need only have to include just the variable name a because...

  1. a already defined as an integer
  2. Anything in between double quotes is going to be represented as a string regardless of what you put in it. (There are some exceptions to this)

In saying that, the questions asks you to put a whole number in the System.out.println parentheses. I'm not sure if placing an int variable will do the same thing but if not then try placing a number directly instead.




This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.