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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:00:28+00:00 2026-05-16T22:00:28+00:00

I am getting error the modifier public is not valid for this item this

  • 0

I am getting error

the modifier public is not valid for this item

this my code, please help me.

    using System;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    public partial class First : System.Web.UI.Page,test 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = test1("Hi", 1).ToString();
        }

    }
    public class Base
    {
        public int test1(int x)
        {
            return x;
        }
        public string test1(string x)
        {
            return x;
        }
        public string test1(string x, int y)
        {
            return x + y;
        }
    }
    public interface test
    {
        public int test1(int x);
        public string test1(string x);
        public string test1(string x, int y);
    }

Thanks,
Pradeep

  • 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-05-16T22:00:29+00:00Added an answer on May 16, 2026 at 10:00 pm

    Your interface declaration should look like this:

    public interface test
    {
        int test1(int x);
        string test1(string x);
        string test1(string x, int y);
    }
    

    Access modifiers are not valid on interface declarations:

    Interfaces consist of methods,
    properties, events, indexers, or any
    combination of those four member
    types. An interface cannot contain
    constants, fields, operators, instance
    constructors, destructors, or types.
    It cannot contain static members.
    Interfaces members are automatically
    public, and they cannot include any
    access modifiers.

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

Sidebar

Related Questions

I have the following code and am getting this error before compiling: Fast Enumeration
I'm getting a very strange error with preg_replace. I'm using the following code: $text=preg_replace('/(\s)?'.preg_quote($f).'(\s)?/','<a
I'm getting an error when using Entity Framework - Code First in the following
Getting error when I tried like this: $ci =& get_instance(); $ci->db->select(CONCAT_WS(' ',users.name_first,users.name_last) AS user_name,CONCAT_WS('
Getting error while inserting values into database (SQL Server 2008) Implicit conversion from data
I'm getting error while using replace in an update statement in sql server 2008.
I am getting error: Invalid argument supplied for foreach() This is my class for
I'm getting below error while updating two tables using entity framework - Object with
Im getting the following error on the code I transleted from C# to VB.NET
Newb here trying to fix my php code. Getting an error at line 89.

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.