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

  • Home
  • SEARCH
  • 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 7749013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:56:02+00:00 2026-06-01T10:56:02+00:00

public class Readparam { private static String method_name; public static HashMap<String, Vector<String>> getParameters(String file_name)

  • 0
public class Readparam
{
    private static String method_name;
    public static HashMap<String, Vector<String>> getParameters(String file_name)
    {
        HashMap temp_map = new HashMap();

        String current_dir = System.getProperty("user.dir");

        File new_file = new File(current_dir + "\\parameters\\" + file_name);

        StringTokenizer stringtok = null;
        StringBuffer temp_contents = new StringBuffer();

        BufferedReader input = null;
        try
        {
            input = new BufferedReader(new FileReader(new_file));
            String current_line = null;

            while (((current_line = input.readLine()) != null) && (current_line.length() > 0))
            {
                stringtok = new StringTokenizer(current_line, "(");

                method_name = stringtok.nextToken();

                String parsed_parameters = current_line.subSequence(current_line.indexOf("(") + 1, current_line.indexOf(")")).toString();

                StringTokenizer paramtok = new StringTokenizer(parsed_parameters, ",");

                String[] parsed_string = parsed_parameters.split(", ");
                String parsing = method_name + "(";

                for (int i = 0; i < parsed_string.length; i++)
                {
                    String[] temp_parse = parsed_string[i].split(" ");
                    if (i < parsed_string.length - 1)
                    parsing = parsing + temp_parse[0] + ", ";
                else {
                parsing = parsing + temp_parse[0];
                }
            }
                parsing = parsing + ")";

                Vector temp_vector = new Vector();
                for (String s : parsed_string) {
                temp_vector.add(s);
            }
                temp_map.put(parsing, temp_vector);
        }
    }
        catch (FileNotFoundException ex)
        {
        System.out.println("File not found: " + file_name);
        String method_name = null;
        return method_name;
    }

any help on this is aprreciated
I have the last line “return method_name that does not compile
i recieve an error incompatible types, expected java.util.hashmap found java.lang.String
the last line return method_name does not compile

  • 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-01T10:56:03+00:00Added an answer on June 1, 2026 at 10:56 am
    System.out.println("File not found: " + file_name);
    HashMap<String, Vector<String>> method_name = null;
    return method_name;
    

    Since your method is of a certain type, you need to ‘cast’ the value that’s being returned to that type.

    If you are coding using Eclipse, you can just click on the little error icon, and it will offer to fix the error for you, and it will cast it for you. If you are not using Eclipse, you might consider it in the future. (NetBeans works in a similar manner)

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

Sidebar

Related Questions

public class PackageTabActivity extends ListActivity{ HashMap<String,Object> hm ; ArrayList<HashMap<String,Object>> applistwithicon ; private static final
public class Order { static Customer cust = new Customer(); string sEmpty = ;
public class InterruptedInput { public static void main(String[] args) { InputThread th=new InputThread(); //worker
public class BobDatabase extends SQLiteOpenHelper{ private static final String DATABASE_NAME = bob.db; private static
public class Bird { private static int id = 0; private String kind; public
public class Base{ protected String str; public static final Base ERROR = new Base(error);
public class PeopleCollection : IEnumerable { private Dictionary<string, Person> listPeople = new Dictionary<string, Person>();
public class Bird { private static int id = 0; private String kind; public
public class Divers { public static void main(String args[]){ String format = |%1$-10s|%2$-10s|%3$-20s|\n; System.out.format(format,
public class Main { public static void main(String []ar) { A m = new

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.