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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:50:08+00:00 2026-06-01T01:50:08+00:00

As you maybe know, as Java language perspective all method in C# are final

  • 0

As you maybe know, as Java language perspective all method in C# are final by default (also vice versa, all methods in Java are virtual as C# language perspective).

In C# we can replace final (non-virtual) methods by new keyword (please see this). There is not anyway to replace final methods in Java?

Edit 1:

I just want to mention that method replacing is not same with method overriding. Please run this C# code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ComapreOverrideWithNew
{
    class Program
    {
        static void Main(string[] args)
        {
            var cat = new Cat();
            cat.PrintNameByNew();
            Console.WriteLine(cat.GetNameByNew());
            cat.PrintNameByOverride();
            Console.WriteLine(cat.GetNameByOverride());
            Console.ReadKey();
        }
    }
    class Animal
    {
        public String GetNameByNew()
        {
            return "Animal";
        }
        public void PrintNameByNew()
        {
            Console.WriteLine(GetNameByNew());
        }

        public virtual String GetNameByOverride()
        {
            return "Animal";
        }
        public void PrintNameByOverride()
        {
            Console.WriteLine(GetNameByOverride());
        }
    }
    class Cat : Animal
    {
        new public String GetNameByNew()
        {
            return "Cat";
        }

        public override String GetNameByOverride()
        {
            return "Cat";
        }
    }
}

For example http://docs.oracle.com/javase/tutorial/java/IandI/final.html is just talking about overriding. Also this code have not any compiler warning on compilation.

  • 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-01T01:50:09+00:00Added an answer on June 1, 2026 at 1:50 am

    You cannot replace final methods in Java.

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

Sidebar

Related Questions

As we know , there are a lot of java decompiler tools which can
Why Java, C and C++ (maybe other languages also) do not allow more than
A simple question that I don't know if Java has also a simple solution.
I know C++ and Java and I am unfamiliar with Pythonic programming. So maybe
I know that you can use reflection in Java to get the name of
The question may at first sound silly, but maybe it isn't at all. Java
I know you can easily expose your database through web services with whichever framework/language
Maybe I just don't know enough about structs and have been using them blindly
Maybe my logic is not restful or know if this is how you would
I know there is a lot of controversy (maybe not controversy, but arguments at

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.