GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Basic-Java/dataTypes.java at main · kavya-7777/Basic-Java Expand file tree/ Copy pathdataTypes.javaMore file actions 31 lines (23 loc) · 778 Bytes / Copy pathdataTypes.javaFile metadata and controls31 lines (23 loc) · 778 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 public class dataTypes{ static public void main(String[] name){ byte a = 123; short b = 12345; int c = 1234567890; long d = 1234567890123456789L; float e = 0.12345678f; double f = 0.12345678901234345; char g = 'A'; boolean h = true; float i = 12e3f; double j = 34E5F; System.out.printf("%d %d %d %d %f %f %.14f %c %b %e %e \n",a,b,c,d,e,f,f,g,h,i,j); //widening casting (implicit-type casting) int myInt = 6; double myDouble = myInt; System.out.println(myDouble); //narrow casting (explicit-type casting) double myDoub = 45.67; int myIn = (int) myDoub; System.out.print(myIn); } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |