Outprintlnsize is integersize int i1 integermaxvalue

This preview shows page 7 - 13 out of 26 pages.

System.out.println("Size is : "+Integer.SIZE); int i1 = Integer.MAX_VALUE; int i2 = Integer.MIN_VALUE ; System.out.println("Max value is : "+i1); System.out.println("Min Value is : "+i2); System.out.println(" For an Byte"); System.out.println("Size is : "+Byte.SIZE); byte b1 = Byte.MAX_VALUE; byte b2 = Byte.MIN_VALUE ; System.out.println("Max value is : "+b1); System.out.println("Min Value is : "+b2); System.out.println(" For an Short"); System.out.println("Size is : "+Short.SIZE); short s1 = Short.MAX_VALUE; short s2 = Short.MIN_VALUE ; System.out.println("Max value is : "+s1); System.out.println("Min Value is : "+s2); System.out.println(" For an Long"); System.out.println("Size is : "+Long.SIZE); long l1 = Long.MAX_VALUE; long l2 = Long.MIN_VALUE ; System.out.println("Max value is : "+l1); System.out.println("Min Value is : "+l2); } }
Image of page 7

Subscribe to view the full document.

Image of page 8
Floating-point Types There are two kinds of two floating point types Type Width in bits Range float (single precision) 32 1.4 e−045 to 3.4e+038 Double(double precision) 64 4.9e–324 to 1.8e+308
Image of page 9

Subscribe to view the full document.

public class FloatDemo { public static void main(String args[]) { System.out.println(" For a Float"); System.out.println("Size is : "+Float.SIZE); float f1 = Float.MAX_VALUE; float f2 = Float.MIN_VALUE ; System.out.println("Max value is : "+f1); System.out.println("Min Value is : "+f2); System.out.println(" For a Double"); System.out.println("Size is : "+Double.SIZE); double d1 = Double.MAX_VALUE; double d2 = Double.MIN_VALUE ; System.out.println("Max value is : "+d1); System.out.println("Min Value is : "+d2); } }
Image of page 10
Image of page 11

Subscribe to view the full document.

Character Data Type char in Java is not the same as char in C or C++. Java uses Unicode to represent characters. Unicode defines a fully international character set that can represent all of the characters found in all human languages. It is a unification of dozens of character sets, such as Latin, Greek, Arabic, Cyrillic, Hebrew, Katakana, Hangul, and many more.
Image of page 12
Image of page 13
  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask bonus questions You can ask questions ( expire soon) You can ask questions (will expire )
Answers in as fast as 15 minutes