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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:15:57+00:00 2026-06-06T04:15:57+00:00

My assignment is to write an overloaded version of iquote() , a method that

  • 0

My assignment is to write an overloaded version of iquote(), a method that displays the type of its argument and its argument enclosed in double quotation marks. I am asked to write three versions: one for int argument, one for a double argument and one for a String argument. I am not required to supply an application part.

This is what i have so far, it will compile however a get an error message: Could not find or load main class assign61

Could someone please help me with this code…

public class assign61 {
     public void iquote(String s){
        return sQuote;
        System.out.println( "sQuote\" );" 
    }
    public void iquote(int n){
        return iQuote;
        System.out.println( "sQuote\" );" 
    }       
    public void iquote(double d){
        return iQuote;
        System.out.println( "sQuote\" );"          
    }
}
  • 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-06T04:15:59+00:00Added an answer on June 6, 2026 at 4:15 am

    Your code can’t be compiling properly because there are errors in it. Therefore, if it wont compile, it can’t be run.

    There are a few changes that you need to make…

    public class assign61 {
    
        public assign61(){
            iquote("Test");
            iquote("123");
            iquote("5.678");
            }
    
        public void iquote(String s){
            System.out.println("sQuote:" + s);
        }
        public void iquote(int n){
            System.out.println("iQuote:" + n);
        }       
        public void iquote(double d){
            System.out.println("dQuote:" + d);       
        }
    
        public static void main(String[] args){
            new assign61();
        }
    
    }
    

    Basically this is what needed to change…

    1. You want to output the value, so this is added to the end of the System.out.println() lines by the + symbol.
    2. You had return statements in your methods, but they aren’t what you want to use. return is for returning a value to the code that called the method – they aren’t for outputting a value to the command prompt.
    3. Because of your return statements, they also would have prevented your code from compiling because you had them written before your System.out.println() statements instead of after them. return can’t have anything written after it in the code. Also, to use return statements, you would need to change your methods to be public int iQuote(int n) instead of using the void statement, so it knows what type of data you’ll be returning from the method
    4. I have added a constructor method assign61 which has some test code in it to show that your other methods work correctly. I have also added the main method so that you can run your code.

    I hope this helps you to understand a little more. Try making some of the changes suggested above, then compile your code. Once it compiles correctly, you will be able to run it. Then you can come back to us with any further problems.

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

Sidebar

Related Questions

This is the assignment: Write a method that sorts the elements of a matrix
Here is the assignment verbatim: 1.) Write a Java program that is a TCP
I have an assignment that wants me to write an ternary search algorithm and
Suppose that the purpose of an assignment is to write a compiler that works
My Java assignment is to to write a Java application that uses data from
Background: my assignment was to write a program that uses linked list to keep
ok so my assignment I'm supposed to write a class that stores a temperature
I have a homework assignment that I am supposed to write a http server
A while back we were given an assignment to write a c program that
I have created a method in my java assignment to write into a file

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.