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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:12:53+00:00 2026-06-12T09:12:53+00:00

Hi guys i have a problem with this code: //Class FileManip public class FileManip{

  • 0

Hi guys i have a problem with this code:

//Class FileManip
public class FileManip{

private HTTPRequest<List<String>> addMe = new HTTPRequest<List<String>>();

    public void openFile(){

            try{
                BufferedReader buff = new BufferedReader(new FileReader("Saturday.txt"));
                try{
                    Double ctr = 0.0;
                    String readHTTPURIFromTxt = buff.readLine();
                    while (readHTTPURIFromTxt!=null){

                        if (!readHTTPURIFromTxt.isEmpty()){
                            addMe.putListHTTPCharTable(parseHTTPReqToCharbyChar(readHTTPURIFromTxt), ctr);
                            ctr++;
                        }
                    readHTTPURIFromTxt = buff.readLine();
                    }
                }

                finally{
                    buff.close();
                }   

            }
            catch(FileNotFoundException e){
                System.out.println("File not found"+e);
            }
            catch(IOException e){
                System.out.println("oist exception");
            }
        }

    public List<String> parseHTTPReqToCharbyChar(String getHTTP){ 
            List<String> parsingReq = new ArrayList<String>();
            String convChar=null;

                for (int x = 0; x<getHTTP.length(); x++){
                    convChar = Character.toString(getHTTP.charAt(x));
                    parsingReq.add(convChar);
                }

            return parsingReq;
        }
}


    //Class HTTPRequest
    public class HTTPRequest<T> {

    private LinkedHashMap<List<T>, Double> tableOfInitProbList = new LinkedHashMap<List<T>, Double>();

    public HTTPRequest(){
        }

    public HTTPRequest(List<T> entry, Double value){
            tableOfInitProbList.put(entry, value);
        }

    public void putListHTTPCharTable(List<T> uri, Double value){
            tableOfInitProbList.put(uri, value);
        }

    }

The problem is the line

addMe.putListHTTPCharTable(parseHTTPReqToCharbyChar(readHTTPURIFromTxt), ctr);

its in class filemanip openfile method inside the if statement. I wrote putListHttpCharTable to take 2 parameters List < T > and Double but whenever I pass the argument parseHTTPReqToCharbyChar(readHTTPURIFromTxt) which has a return type of List there is a compile time error. It reads

The method putListHTTPCharTable(List>, Double) in the type HTTPRequest> is not applicable for the arguments (List, Double)

I passed a method which has List < String > return type but somehow the compiler is trying to read it as List< List < T > > or a List < List < String > > instead of just being List < String >. Is there anyway to fix this?

  • 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-12T09:12:53+00:00Added an answer on June 12, 2026 at 9:12 am

    Because :

    HTTPRequest<List<String>>
    

    means :

    T <=> List<String> 
    

    so the compiler sees this (for your “addMe” variable):

    //Class HTTPRequest
        public class HTTPRequest<List<String>> {
    
        private LinkedHashMap<List<List<String>>, Double> tableOfInitProbList = new LinkedHashMap<List<List<String>>, Double>();
    
        public HTTPRequest(){
            }
    
        public HTTPRequest(List<List<String>> entry, Double value){
                tableOfInitProbList.put(entry, value);
            }
    
        public void putListHTTPCharTable(List<List<String>> uri, Double value){
                tableOfInitProbList.put(uri, value);
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok guys, I have a serious problem with this. I have a static class
Hey guys, I have this code within a function inside a class that is
I hope some of you guys can help me with this problem.... I have
hey guys having this really simple problem but cant seem to figure out have
Hi guys i have a problem i my code i set a datepicker with
Why does this code stop with segmentation fault : class MapFile { public: /*
Hey guys, I have a problem with a code that I've been writing. I
I have a problem freeing up memory of an object.Here is my code: void
following is the code listed in MainClass.java. public class MainClass { public static void
I have this code in a business class. internal ListItemCollection GetAllAgents() { DataTable table

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.