Question: So this question is to let the user enter the product id, the name, how much in stock and how much is bought from the store. Everything in the code works just fine but when I enter the letters for the name, only the first letter shows up.

```
import java.util.Scanner;

public class ProductStock {

  public static void main(String[] args) {
    {
      Scanner sc = new Scanner(System.in);
      int id = sc.nextInt();
      char name = sc.next().charAt(0);
      int stock = sc.nextInt();
      int sold = sc.nextInt();
      sc.close();
      System.out.print(id + " " + name + " " + stock + " " + sold);
    }
  }
}

```

Answer: 
A `char` in Java represents a single *character*. To have a sequence of characters, you should use a [`String`](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html). With using `charAt(0)` in your snippet, you only take the first character of the name you input, but you want to keep the whole String. By calling `next()` on the scanner, you actually get a `String` as the return value, so there is nothing more to do.

The fixed example should look like this:

```
public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int id = sc.nextInt();
    String name = sc.next();
    int stock = sc.nextInt();
    int sold = sc.nextInt();
    System.out.print(id + " " + name + " " + stock + " " + sold);
    sc.close();
}

```

Just a heads up: once you should be aware that calling `close()` on a `Scanner` using `System.in`, you won't be able to use System.in for the rest of the runtime of your program.
in code `char name` was storing only the first character and because of `char` which can only store one character and print that one, so you have to use `String` for storing and displaying a complete text.

```
Scanner sc = new Scanner(System.in);

int id = sc.nextInt();
String name = sc.next();
int stock = sc.nextInt();
int sold = sc.nextInt();
sc.close();
System.out.print(id + " " + name + " " + stock + " " + sold);

```