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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:35:00+00:00 2026-06-17T16:35:00+00:00

Out of curiosity I just decompiled below code using DJ Java Decompiler as well

  • 0

Out of curiosity I just decompiled below code using DJ Java Decompiler as well using CAVAJ Java Decompiler
( Java version is 1.7 )
here is the normal source code :


    byte a = 10;
    a = (byte) (a +1);

    byte b = 10;
    b = b++;

    byte c = 10;
    c +=c;

    System.out.printf("a=%d \t b=%d \t c=%d\n",a,b,c);

Which shows output as: a=11 b=10 c=20



And here is the decompiled one:

    byte a = 10;
    a++;
    byte b = 10;
    b++;
    b = b;
    byte c = 10;
    c += c;
    System.out.printf("a= %d \t b = %d \t c = %d\n", new Object[] {
        Byte.valueOf(a), Byte.valueOf(b), Byte.valueOf(c)
    });

Which when used as source code output as: a=11 b=11 c=20


To be more clear it has nothing to do with byte same thing happening for int as well and I even checked above codes in online compiler IDEONE and giving the same output as mine.

So, is the decompiler producing wrong code or is something else ??

  • 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-17T16:35:02+00:00Added an answer on June 17, 2026 at 4:35 pm

    I will give you short answer: yes, it seems, that the decompiler is producing wrong code.
    Because this one:

    byte b = 10;
    b = b++;
    

    has strongly predicted behavior (b will not change).

    UPD: Furthermore, no one of decompilers can give you 100% warranty of the correctness of generated decompiled code.

    UPD-2: Are you sure, that you provide us actual version of your code? Because this one:

    byte aa = 10;
    a = (byte) (a +1);
    

    of course is a mistake. It even will not compile 🙂

    UPD-3 Well, I need to say, that Jad decompiler (Jad 1.5.8g for Windows 9x/NT/2000 on Intel platform) produces the same code:

        byte b = 10;
        b++;
        b = b;
    

    …

        java.lang.System.out.printf("a=%d \t b=%d \t c=%d\n", new java.lang.Object[] {...
    

    But this is not surprising: Cavaj Java decompiler uses Jad as its Java decompiling engine.

    Conclusion: Consider this behavior as a feature/bug of Jad decompiler, which is far from a perfection.

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

Sidebar

Related Questions

Just out of curiosity, asking this Like the expression one below a = (condition)
Just out of curiosity: What's the oldest code/package in a typical linux distro? Emacs?
Just out of curiosity... Is there a way to add using to an ASPX/ASCX
Just out of curiosity, I wanted to try emacs + evil. Here's what I've
Just out of curiosity ,I am asking you a question which is as below:
ok this is just strickly out of curiosity here because i have read some
Just out of curiosity. Can we compile & run a java file from another
This is just out of curiosity I ask... 99% of the code I see
Just out of curiosity: How could this (rather ugly) Rails code be prettified /
Just out of curiosity, I'm trying to figure out which exactly is the right

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.