instanceof java
Posts: 576
Nickname: instanceof
Registered: Jan, 2015
instanceof java is a java related one.
Integer Wrapper class
Posted: Jun 18, 2015 7:36 AM
This post originated from an RSS feed registered with Java Buzz
by instanceof java.
Original Post: Integer Wrapper class
Feed Title: Instance Of Java
Feed URL: http://feeds.feedburner.com/blogspot/TXghwE
Feed Description: Instance of Java. A place where you can learn java in simple way each and every topic covered with many points and sample programs.
Latest Java Buzz Posts
Latest Java Buzz Posts by instanceof java
Latest Posts From Instance Of Java
Advertisement
Integer class is present in java.lang package. java.lang.Integer is used to represent integer primitive value in form of object. Class Definition public final class Integer extends Number implements Comparable<Integer> Integer Class Constructors 1.public Integer(int value) :
It takes int primitive value as an argument. Java code to convert int primitive to Integer object package com.instanceofjavatutorial; public class IntegerDemo { public static void main(String[] args) { Integer obj=new Integer (37); System.out.println(obj); } } Output: 2.public Integer(String s) throws NumberFormatException: It takes String value as an argument. Java code to convert String to Integer object package com.instanceofjavatutorial; public class IntegerDemo { public static void main(String[] args) { Integer obj=new Integer ("123"); System.out.println(obj); } } Output:
Read: Integer Wrapper class