.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


 
Home >> Interview Question >> C# >> Post New Question Subscribe to Interview Questions
 
Quick Links For Interview Questions Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  OOPs  JQuery  JavaScript/VBScript
BiztalkPatten/Practices.IISWCFWPFWWF
NetworkingAptitudeOthers  All    

Difference between Int32.Parse,Convert.Int32

Author: syed shakeer hussain          Posted Date: 28/06/2009     Category: C#     Points: 10

Answer: Int32.Parse Method:
-------------------
Converts the string representation of a number to its 32-bit signed integer equivalent.
-When s is a null reference, it will throw ArgumentNullException.
-If s is other than integer value, it will throw FormatException.
-When s represents a number out of range, it will throw OverflowException.

Convert.ToInt32(string):
-------------------------
Converts the specified string representation of 32-bit signed integer equivalent. This calls in turn Int32.Parse () method.
-When s is a null reference, it will return 0 rather than throw ArgumentNullException.
-If s is other than integer value, it will throw FormatException.
-When s represents a number out of range, it will throw OverflowException.

Int32.TryParse Method:
----------------------
Converts the specified string representation of 32-bit signed integer equivalent to out variable, and returns true if it is parsed successfully, false otherwise.
-When s is a null reference, it will return 0.
-If s is other than an integer value, the out variable will have 0.
-When s represents a number out of range, the out variable will have 0.





Product Spotlight

Featured Articles


Design Pattern Interview Questions Part (3)
Software Architecture Interview Questions Part 3 State Pattern, Stratergy pattern,Visitor pattern, Adapter and fly weight ... Read More
Software Architecture Interview Questions Part 4- Design Patterns
(A) Can you explain bridge pattern? (A) Can you explain composite pattern? (I) Can you explain decorator pattern ? (A) Can you explain Façade pattern? (A) Can you explain chain of responsibility ( COR)? (I) Can you explain proxy pattern? (B) Can you explain template pattern? ... Read More
UML Interview Question Part 1
(B) Define UML? (I) Can you explain use case diagrams? (I) Can you explain primary and secondary actors? (I) How does a simple use case look like? (I) Can you explain 'Extend' and 'Include' in use cases? (I) Can you explain class diagrams? (B) How do we represent private, public and protected in class diagrams? (I) what does associations in a class diagram mean? (I) Can you explain aggregation and composition in class diagrams? (A) What are composite structure diagram and reflexive association in class diagrams? ... Read More
 

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend