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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:40:35+00:00 2026-06-18T08:40:35+00:00

I know there is already many question about turning a string into runnable code,

  • 0

I know there is already many question about turning a string into runnable code, but my question is a little different. Lets say you have a class with a method called: public boolean isSame(boolean a, boolean b), and a String that contains: "if(a == b) { return true; } return false". Is there a way to add the contents of the string to the code of the method? So the final result will be:

public boolean isSame(boolean a, boolean b){
    if(a == b){
        return true;
    }
    return false;
}

Thank you very much.

Edit: I totally understand if this is not possible, but it is worth asking :).

  • 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-18T08:40:36+00:00Added an answer on June 18, 2026 at 8:40 am

    Perhaps you could use the BECL library – it’s a byte code engineering library that, although not renowned for performance, is renowned for ease of use.

    The thing that makes it interesting in your case:

    Unlike other byte code engineering libraries that provide an abstraction on top of byte-code, it works by decompiling a class, weaving in the required code and then compiling it again. . . and this happens for the the class loading phase. . . theoretically this would allow you to insert valid code in a string format before or after the original method invocation.

    Essentially using the compiler as per suggestions in the comments section of your question, but does a little extra work for you.

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

Sidebar

Related Questions

I know there is a question about this subject already but I think it's
I know there are already many questions like mine but I found no answer
I know there are already some posts about this topic, but I cannot find
There's already a question on this here. But i want to know if its
I know there are many topics and resources about this, but I'm wondering about
First of all: I do know that there are already many questions and answers
I know there are already objects supporting Office 2007 files, but is there any
Hey I know there are already a few posts about this - yet I
I know there are plenty of questions here already about this topic (I've read
I know that there are similar questions which are already answered, but I am

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.