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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:04:20+00:00 2026-05-26T17:04:20+00:00

I am trying to learn java from a C# background! I have found some

  • 0

I am trying to learn java from a C# background! I have found some nuances during my journey like C# doesn’t have an Integer as reference type it only has int as a primitive type; this lead me to a doubt if this translation would be correct!

  String line ="Numeric string";//Java
  string line = "Numeric string";//C#
  int size;

  size = Integer.valueOf(line, 16).intValue(); //In Java

  size = int.Parse(line,System.Globalization.NumberStyles.Integer);//In C#
  • 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-05-26T17:04:21+00:00Added an answer on May 26, 2026 at 5:04 pm

    No, that’s not quite a valid translation – because the 16 in the Java code means it should be parsed as an integer. The Java code is closer to:

    int size = Convert.ToInt32(line, 16);
    

    That overload of Convert.ToInt32 allows you to specify the base.

    Alternatively you could use:

    int size = int.Parse("11", NumberStyles.AllowHexSpecifier);
    

    I’m not keen on the name “allow hex specifier” as it suggests that a prefix of “0x” will be accepted… but in reality it means it’s always interpreted as hex.

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

Sidebar

Related Questions

I'm trying to learn C from a Ruby/PHP/Java background, and I've found that you
I'm trying to learn web development in Java and, from what I have seen
I am from C#, Java background trying to learn C++. The following is a
I am trying to learn Java by doing some assignments from a Stanford class
I'm coming from a .NET background and trying to learn Java. I keep seeing
I'm coming from a background in C++ and Java, and trying to learn Javascript
I'm trying to learn Erlang, coming from a C++/Java background. This forces me to
I'm trying to learn C now, I'm coming from Java and there is some
I am trying to learn Java. I would like to implement a simple networked
Trying to learn about php's arrays today. I have a set of arrays like

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.