Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8670423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:42:14+00:00 2026-06-12T18:42:14+00:00

Im getting Exception in thread main java.lang.Error: Unresolved compilation: at FileTest.main(FileTest.java:39) Line 39 is

  • 0

Im getting Exception in thread “main” java.lang.Error: Unresolved compilation: at FileTest.main(FileTest.java:39) Line 39 is public static void main(String[] args){what am I doing wrong?

public class FileTest{
    public static void main(String[] args){

        try{
            String inFileName = args[0];
            String outFileName = args[1];
            BufferedReader ins= new BufferedReader(new FileReader(inFileName));
            BufferedReader con = new BufferedReader(new InputStreamReader(System.in));
            PrintWriter outs = new PrintWriter(new FileWriter(outFileName));

            String first = ins.readLine(); //read from file
            while(first != null){
                System.out.print("Type in a word to follow " + first + ":");
                String second = con.readLine(); //read from console
                //append and write 
                outs.println(first+ ", " + second);
                first = ins.readLine(); //read from file
            }
            ins.close();
            outs.close();
        }
        catch (IOException ex){
            ex.printStackTrace(System.err);
            System.exit(1);
            }

        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:42:15+00:00Added an answer on June 12, 2026 at 6:42 pm

    You appear to have too many braces. You can delete the last } character to make this code compile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the error I'm getting: Exception in thread main java.lang.Error: Unresolved compilation problem:
I'm getting the error Exception in thread main java.lang.NumberFormatException: For input string: scores.txt at
I am getting this error: Exception in thread main java.lang.OutOfMemoryError: Java heap space at
I've been getting this Java runtime error: Exception in thread main java.lang.UnsatisfiedLinkError: no jogl
I'm getting the error: Exception in thread main java.lang.NullPointerException at com.deanchester.minos.utils.DatabaseManager.createTables(DatabaseManager.java:59) at com.deanchester.minos.tests.testAddContestantMethod.main(testAddContestantMethod.java:21) I
Exception in thread main java.lang.NullPointerException at com.hibernate.UserDAO.findAll(UserDAO.java:154) at test.main(test.java:12) I am getting this error
I'm getting the error Exception in thread main java.lang.NullPointerException when I try to read
I keep getting a ClassCastException Exception in thread main java.lang.ClassCastException: java.lang.String cannot be cast
I'm getting the following error message : Exception in thread main java.lang.NoClassDefFoundError: LU62XnsCvr (wrong
I am getting the following error Exception in thread main java.lang.ClassCastException: org.hibernate.impl.SessionFactoryImpl cannot be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.