Abundant Code

  • C#
  • C++
  • Elastic Search
  • Entity Framework
  • F#
  • JavaScript
  • ASP.NET
  • C
  • Java
  • SQL Server
  • Assembly Lang
Home ยป How to in Java

Java – How to Convert primitive long datatype to Long object?

March 4, 2016 by AbundantCode Leave a Comment

Problem Statement You need to convert the primitive long datatype to object in Java. Solution Use the Long wrapper class to convert the long primitive to Long object as shown below. The output of the above program is Abundantcode.com Java Tutorials 89

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

Java – How to Convert Long to String in Java ?

March 3, 2016 by AbundantCode Leave a Comment

Problem Statement You need to convert long to a string value in your java program. Solution Use the toString method to convert long to string in Java. The output for the above program is Abundantcode.com Java Tutorials 75

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

Java – How to Convert Numbers to Objects and vice versa ?

March 3, 2016 by AbundantCode Leave a Comment

Problem Statement You need convert numbers to objects and vice versa in your Java program. Solution There are times when you need to pass an object for a function where you have a numeric values. To convert numbers to objects and vice versa , you can use the corresponsing wrapper classes. For example , if […]

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

Java – How to Read Integers from the Console for calculation ?

March 3, 2016 by AbundantCode Leave a Comment

Problem Statement You need to read integers from the console window and use it for calculation within your java program. Solution If you want to know how to read integer value from a console and use it for calculation , you can use the Scanner class as shown below. The output of the above program […]

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

Java – How to read a valid Integer number from Console ?

March 3, 2016 by AbundantCode Leave a Comment

Problem Statement You need to read a valid integer number from the Console in your java program. If the number is invalid , show appropriate message. Solution To read a valid integer from a console program , you can use the Scanner class and pass the System.in as the parameter to its constructor. The scanner […]

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

Java – How to decode string from Hexadecimal and Octal to Integer in Java ?

March 3, 2016 by AbundantCode Leave a Comment

Problem Statement You need to decode a string from hexadecimal to integer in java as well as octal to integer. Solution Use the decode method defined in the Integer class to decode an hexadecimal and octal number to integer as shown below. The output of the above program is 255 46

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

Java – How to declare Hexadecimal literal ?

March 3, 2016 by AbundantCode Leave a Comment

Problem statement You need to declare an Hexadecimal literal in Java and display the result on a console window. Solution Hexadecimal numbers can contain numbers from 0-9 as well as characters A-F where A-F represents 10-15. You can prefix the numbers with 0X to denote it as hexa decimal number as shown below. The output […]

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

Java – How to Convert String to Long ?

March 2, 2016 by AbundantCode Leave a Comment

Problem Statement You need to convert a java string to long in your java program. Solution The output of the above program is Abundantcode.com Java Tutorials 75 79

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

How to Declare an Octal literal in Java ?

March 2, 2016 by AbundantCode Leave a Comment

Problem Statement You want to declare an octal literal in Java. Solution Prefix the value with 0. A literal that contains leading zero is an octal number. The output of the above program will be 8 21

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

Java – How to convert Long to other primitive numeric data types ?

March 2, 2016 by AbundantCode 2 Comments

Problem Statement You need convert a long value to other numeric data types in java. Solution Use the Long wrapper class which exposes methods like byteValue , shortValue , intValue etc. Below is a sample code snipper demonstrating the usage of the same. The output for the above program is Abundantcode.com Java Tutorials 76 76 […]

Filed Under: Java Tagged With: guide, How to in Java, Java, tutorials

  • 1
  • 2
  • Next Page »
RSS
Facebook
fb-share-icon
Twitter
Visit Us
Follow Me
Tweet

Recent Posts

  • Collapsible links for subcategories in Docusaurus Sidebar
  • Python Program to Print Fibonacci Series
  • Python Program to Generate Multiplication Table
  • Python Program to Find the Factorial of a Number
  • Python Program to Print Prime Numbers in a Given Interval

Categories

Tags

.NET App Array ASP.NET ASP.NET MVC Assembly Language C# C# programs c lab programs Collection convert C program csharp database Example F# guide How to How to in Java integer Java Javascript Lab programs Lambda LINQ List Python lab programs Python programs SIC/XE SQL Server string tips tricks tutorial tutorials UWP visual studio 2015 Windows Windows 8 Windows 10 Windows Phone Windows Phone 8 Windows Phone 8.1 wp8 XAML

Blog Stats

  • 8,730,834 hits

Archives

Top Posts & Pages

  • C Program to Multiply Two Matrices Using Multi-dimensional Arrays
  • C Program to display half-pyramid using alphabets
  • How to open display settings from command line in Windows 10 ?
  • How to Extract number from a string using C# ?
  • How to Convert a Stream to Byte Array in C# 4.0 ?
  • How to clean up unused PowerPoint master slides in PowerPoint?
  • Json.NET & VB.NET - How to Serialize an Object ?
  • How to retrieve the URL of the current Page in ASP.NET MVC 4 Controller ?
  • How to get the Relative Server Path in ASP.NET Web API ?
  • How to compare two Byte Arrays in C#?

Categories

  • Android
  • Angular 2
  • ASP.NET
  • Assembly Language
  • C
  • C#
  • C++
  • Elastic Search
  • Entity Framework
  • Excel
  • F#
  • HTML
  • Interview Questions
  • Java
  • JavaScript
  • jQuery
  • Microsoft Office
  • MySQL
  • NETWORK
  • News
  • PHP
  • popular
  • PowerShell
  • Python
  • Ruby
  • SharePoint
  • SQL Server
  • SQL Server
  • Unix
  • VB.NET
  • Visual Studio
  • WebAPI
  • Windows
  • Windows Azure
  • Windows Forms
  • XAML

Top Posts & Pages

  • C Program to Multiply Two Matrices Using Multi-dimensional Arrays
  • C Program to display half-pyramid using alphabets
  • How to open display settings from command line in Windows 10 ?
  • How to Extract number from a string using C# ?
  • How to Convert a Stream to Byte Array in C# 4.0 ?
  • How to clean up unused PowerPoint master slides in PowerPoint?
  • Json.NET & VB.NET - How to Serialize an Object ?
  • How to retrieve the URL of the current Page in ASP.NET MVC 4 Controller ?
  • How to get the Relative Server Path in ASP.NET Web API ?
  • How to compare two Byte Arrays in C#?

Recent Posts

  • Collapsible links for subcategories in Docusaurus Sidebar
  • Python Program to Print Fibonacci Series
  • Python Program to Generate Multiplication Table
  • Python Program to Find the Factorial of a Number
  • Python Program to Print Prime Numbers in a Given Interval
  • Python Program to Check Prime Number
  • Python Program to Find the Largest Value Among Three Numbers
  • Python Program to Check If a Given Year is Leap Year
  • Python Program to Check if a Number is Odd or Even
  • Python Program to Check if a Number is Positive, Negative or Zero

Tags

.NET App Array ASP.NET ASP.NET MVC Assembly Language C# C# programs c lab programs Collection convert C program csharp database Example F# guide How to How to in Java integer Java Javascript Lab programs Lambda LINQ List Python lab programs Python programs SIC/XE SQL Server string tips tricks tutorial tutorials UWP visual studio 2015 Windows Windows 8 Windows 10 Windows Phone Windows Phone 8 Windows Phone 8.1 wp8 XAML