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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:28:05+00:00 2026-06-17T04:28:05+00:00

I need to translate C++ code to Java. I have two issues I am

  • 0

I need to translate C++ code to Java. I have two issues I am worried about.

1) Translation of ‘unsigned int’ from C++ to Java as ‘long’.
I choose to use long to increase storage capacity.

2) Use of bitwise operators, specifically | and <<. Given that
I have translate the unsigned int values to long, would this have
any bad effect for these operators? For example in C++:

unsigned int a;
unsigned int b;
unsigned int c;

a | (b<<c)

is it OK to do this in Java:

long a, b, c;

a | (b<<c)

Please let me know about any issues you think I might encounter
doing these things.

Thanks

  • 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-17T04:28:06+00:00Added an answer on June 17, 2026 at 4:28 am

    I believe what you do is safe and should work well in Java. Bitwise operations used as you show should work as expected.

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

Sidebar

Related Questions

I have never used ruby but need to translate this code to java. Can
I have a code that need to be translated from C to Cpp, and
I have a task where I need to translate a DataTable to a two-dimensional
I need to translate some python and java routines into pseudo code for my
I need to port code from Java to C#. In the Java code, the
I have to use an Objective C code and translate it into Java for
i'm trying to translate code from javascript to jquery and i need a little
I have a case where I need to translate (lookup) several values from the
I need to translate the following code to C# from php. What libraries /
The line of code i need to translate from C++ to C#: void GetAnalysisModeName(

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.