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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:44:25+00:00 2026-06-07T22:44:25+00:00

I did my best to Google this but couldn’t find a clean answer in

  • 0

I did my best to Google this but couldn’t find a clean answer in a table-like form that shows type conversions.

The reason I would like to convert these types, is because I am using the Android NDK to call functions from native code. The problem is that the native code calls different types that do not exist in Java.

I actually have no experience in C, and have found these few types from looking at code quickly. Please feel free to edit this post to add different types to be converted.

From C to Java

long ->

short ->

char ->

unsigned long ->

unsigned short ->

unsigned char ->

byte ->

Int8 ->

Int16 ->

Int32 ->

UInt8 ->

UInt16 ->

UInt32 ->

Also, if any of these cannot convert into a Java type, please explain why.

  • 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-07T22:44:26+00:00Added an answer on June 7, 2026 at 10:44 pm

    These are the equivalences, bearing in mind that the size of a primitive data type in Java is always the same, whereas the size of a data type in C is to some extent compiler-and architecture-specific, as pointed by @millimoose in the comments.

    Also, be aware that the char data type is defined as “smallest addressable unit of the machine that can contain basic character set. It is an integer type. Actual type can be either signed or unsigned depending on implementation”, whereas in Java is a single 16-bit Unicode character.

    long -> long
    short -> short
    char -> char
    unsigned long -> N/A
    unsigned short -> N/A
    unsigned char -> N/A
    byte -> byte
    Int8 -> byte
    Int16 -> short
    Int32 -> int
    UInt8 -> N/A
    UInt16 -> N/A
    UInt32 -> N/A
    

    In Java there are no unsigned primitive data types. The byte type uses 8 bits, int 32 bits, short 16 bits and long 64 bits.

    Here’s a link to the relevant section in the Java tutorial, and a more detailed explanation in section §4.2 of the Java Language Specification.

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

Sidebar

Related Questions

This is a noob question at its best but Google isn't finding what I
Did actually someone make already a tutorial that shows how to customize an UITableView?
First off, I did look on google and stackoverflow, but nothing seem to really
I apologize if this question was asked already before but I could not find
What is the best way to place/layout the google+1 and facebook Like buttons so
I did some searches on google for this and there are a lot of
I am aware of the duplicates of this question: How does the Google Did
bit of a n00b question this one but I haven't been able to find
I did some research into the easiest/best way to generate a pdf in my
What is the best way to rotate a image in asp.net I did use

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.