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 9007717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:45:46+00:00 2026-06-16T01:45:46+00:00

I am trying to refactor a large program in Netbeans and I am a

  • 0

I am trying to refactor a large program in Netbeans and I am a bit lost. I haven’t ever been very modular but am trying to correct that now, and for the future by actually learning how to do this. Unfortunately I am having trouble translating some of the tutorials to my beast of a program. SO I was hoping someone here could help. Currently I am trying to break off a chunk of code that takes a file of a specific format and makes a table. I know that I need to make a class and use it to create a table object but I am unsure how.
I have a main that gets command line input for where a file is located:

public class Print {
  public static void main(String[] args) throws Exception {
            // I know this part works
     JSAP jsap = new JSAP();
     FlaggedOption opt3 = new FlaggedOption("cllmap")
            .setRequired(true)
            .setShortFlag('c')
            .setLongFlag("call map");
     opt3.setHelp("Where is the flu, map file? Full path");
     jsap.registerParameter(opt3);
     String cllmp = config.getString("map");

I haven’t tried to reference any of the new classes I made yet because I have not figured out how to do it correctly yet.
Then I try to send the location of the file to another class so that the other class can read in the file and parse it into a table object.

public class Reader extends Print {
 String inpt;

public class FReader {
    //reading in
 //throws exception error
    FileInputStream fstream = new FileInputStream(cllmp);
    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));
    while ((inpt  = br.readLine()) != null) {
        if (!inpt.equals("Calls")) {
          ...

So why does my class FReader throw an exception and how to I make it stop? I can’t say public class FReader throws Exception{ because I then get the error: '{' expected same with putting it after extends Fingerprint2.
What am I doing wrong here? Any suggestions?

  • 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-16T01:45:47+00:00Added an answer on June 16, 2026 at 1:45 am

    Code must be put in methods, and not directly in the class body. The class is called Reader, so it should probably have a read() method, and this method should read, and throw an IOException if it can’t do it:

    public class Reader extends FingerPrint2 {
        public String read() throws IOException {
            // PUT YOUR CODE HERE
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to refactor out my application a little bit to keep it
I Am trying to refactor my code for a series of Django models, but
I am trying to refactor a class that I have into 2 classes. Unfortunately
I am trying to refactor my code so that it follows good OO pattern,
I'm working with Dynamics CRM 2011 Online and trying to refactor some code that
I'm trying to refactor my code to avoid DRY and found that I'm doing
So I have this query written by someone else that I'm trying to refactor,
I'm trying to refactor some code here that was done previously by other guys,
I am trying to refactor some code I wrote that uses IndexedDb. Ideally what
I have repetitive code that i am trying to refactor into a generic function

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.