Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

am trying to make a file that store values form a menu. giving the user diffrent choices to make

// how do i make it work??

import java.util.Scanner;
import java.io.File;

public class dvdButikk{

public static void main(String[] args)throws Exception {
File nyFil = new File("dvdarkiv.txt");
Scanner scanner = new Scanner(nyFil);

Scanner scan = new Scanner(System.in);
int tast = 0;

while (tast != 7){
  System.out.println("Meny for DVD administrasjon");
  System.out.println("1. Ny person");
  System.out.println("2. Kjop");
  System.out.println("3. Laan");
  System.out.println("4. Vis person");
  System.out.println("5. Vis oversikt");
  System.out.println("6. Retur");
  System.out.println("7. Avslutt");
  tast = Integer.parseInt(scan.nextLine());
}
}

1 Answer

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Hi mohammed elhajoui !

In the Java Data Structures course you will build a Karaoke machine that uses a menu similar to this, I think you will benefit from the proper data structure.

Keep at it! Craig