Java Practical No.15 & 16.pdf

  • Uploaded by: Meer Kukreja
  • 0
  • 0
  • June 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Java Practical No.15 & 16.pdf as PDF for free.

More details

  • Words: 87
  • Pages: 2
15.1) Write a program to convert String value into Integer Wrapper class objects. PROGRAM: class util { public static void main(String args[]) { String s ; s="1101"; int i; i=Integer.parseInt (s,2); System.out.println(i); } } OUTPUT:

15.2) write a program to convert integer object value into primitive data-type byte,short, and double value. PROGRAM: Class help { public static void main(String args[]) { Integer i =new Integer(10); byte b = i.byteValue(); System.out.println("Byte ="+b);

double d = i.doubleValue(); System.out.println("Double ="+d);

short s = i.shortValue(); System.out.println("Short = "+s); } }

OUTPUT:

Related Documents


More Documents from "Meer Kukreja"