Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Java
  3. Question
Java

How to edit class files?

Asked by Sakai Ando Oct 14, 2022 1.4K views 1 answer
Share

About this question

I have java code that is compiled to a .class file. There is a function that gets few parameters and do some action (e.g. get int x and int y and do x+y)

I want to add to this .class file code that checks if x=1 and call to another function(e.g. call to x-y and don't do x+y)

How can I edit a compiled .class file and add my own code?


Your answer

1 Answer

More Java discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Java Blogs

Guides, tips and career advice on Java from JanBask experts.