GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Basic-Java/dataTypes.java at main · kavya-7777/Basic-Java

Expand file tree

/

dataTypes.java

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
31 lines (23 loc) · 778 Bytes
/

dataTypes.java

Copy path

File metadata and controls

31 lines (23 loc) · 778 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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.