Video is locked.

Unlock the full course today

Join today to access over 15,000 courses taught by industry experts or purchase this course individually.

Advanced Java Programming

Creating a new file

From the course: Advanced Java Programming

Start my 1-month free trial
  • Course details

    Want to get more out of the Java language and platform? In this platform- and framework-neutral course, instructor Bethan Palmer digs into some of the language’s more advanced features, helping you expand your programming skills as she equips you with techniques you can use when building applications anywhere Java is used: in web, mobile, and desktop applications. Bethan covers a variety of topics, including generics, working with the Collections Framework, and functional programming. Plus, learn about I/O in Java, working with files and directories, and structuring applications using the modular system available in Java.

    Instructor

    • Click here to view Bethan Palmer’s instructor page

      Bethan Palmer

      Software Developer and Java Champion

      Bethan Palmer is a developer who loves technology and has a master's degree in computer science.

      For her day job, Bethan is a Java programmer and the product manager for a Java PDF library at IDRsolutions. She gets to spend a lot of time writing and refactoring code, as well as deciding on product strategy and road maps.

      She also spends much of her time attending conferences and is a regular speaker at Oracle Code One and NetBeans Days. She manages and writes articles about Java, technology, the books she's reading, and conferences she's attending on the Java PDF blog.

    Skills covered in this course

  • Learn advanced Java programming

    - In this example, I want to create a new file on my computer. I don't actually want to put anything in it at the moment, I just want it to exist. If I wanted to write something to a file, I would need to use either a file output stream or a file writer, but to simply create a file, I don't need to use these. In the main method of my file-creation example class, I will create a new file object called myFile. I'll put = new File(). Then I need to pass in the path of where I would like the file to be. For now, I will just put the file on my desktop, and I will call it myFile.txt. I also need to add input statements to use File. If I run the program now, it builds successfully. However, I haven't actually created a file, I've just created a file object. This is just an abstract representation of a file. If I open my desktop folder, there is no file called myFile.txt. To create a file, I need to call another method, so I need to do myFile.createNewFile(). I will also need to handle the…

  • Practice while you learn with exercise files

    Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.

    Download the exercise files for this course. Get started with a free trial today.

  • Download courses and learn on the go

    Watch courses on your mobile device without an internet connection. Download courses using your iOS or Android LinkedIn Learning app.

    Watch this course anytime, anywhere. Get started with a free trial today.

Contents