Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: what is missing for txt to work I have several errors

  1. #1
    Junior Member
    Join Date
    May 2019
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy what is missing for txt to work I have several errors

    what is missing for txt to work I have several errors

    package javaaplication;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.util.ArrayList;
    import java.util.Scanner;
     
    public class Archivo{
        public void lecturatxt();
    }
        Scanner archivo=null;//no deja que haya algun error al momento el archivo
        try{//busca el archivo en la ruta escrita y lo guarda 
        FileReader fr=new FileReader("C:\\Users\\FLOR\\Documents\\NetBeansProjects\\JavaApplication2\\src\\javaapplication2");
        archivo=new Scanner (fr);//escanea el archivo
    }
        catch(Exception e){
        System.out.println("Archivo no encontrado");
     
    }

  2. #2
    Member John Joe's Avatar
    Join Date
    Jun 2017
    Posts
    277
    My Mood
    Amused
    Thanks
    8
    Thanked 19 Times in 19 Posts

    Default Re: what is missing for txt to work I have several errors

    You have lots of error here.

    1. Remove the } after public void lecturatxt();
    2. You miss one }
    3. What is function lecturatxt suppose to do ? You need to define body to it !
    Last edited by John Joe; May 31st, 2019 at 01:37 AM.
    Whatever you are, be a good one

Similar Threads

  1. Replies: 3
    Last Post: January 26th, 2014, 11:51 PM
  2. how to work wsimport for this WSDL i get errors and i cant make it work
    By pato.llaguno in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 24th, 2014, 05:27 PM
  3. no errors on japplet but it doesnt work!!!!
    By game06 in forum Java Theory & Questions
    Replies: 16
    Last Post: May 2nd, 2013, 09:20 AM
  4. Can't work out how to read object from .txt file
    By goformickey in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 25th, 2012, 01:27 AM
  5. How to make Eclipse work with txt file?
    By Prostak in forum What's Wrong With My Code?
    Replies: 6
    Last Post: November 4th, 2011, 05:43 PM

Tags for this Thread