0% found this document useful (0 votes)
81 views

Java Keywords: Incidents Per 100 Lines Incidents Per 100 Lines

Java keywords cheat sheet

Uploaded by

Moosa Baloch
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views

Java Keywords: Incidents Per 100 Lines Incidents Per 100 Lines

Java keywords cheat sheet

Uploaded by

Moosa Baloch
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Java Keywords © Copyright 1998-2002 by Markus Falkhausen, all rights reserved.

Most recent version: www.falkhausen.de

Incidents per Incidents per


Kategory Keyword Example 100 Lines
Kategory Keyword Example 100 Lines

boolean boolean isOpen = true; .82 public public int i; 4.65


byte byte i1 = -128; .67 protected protected int i; .64
char char c = '\uFFFF'; .27 private private int i; 1.10
short short i2 = -32768; .14 static static int i; 1.56
Primitive types
int int i = -2147483648; 4.35 final final int i; .92
Modifier
long long i8 = -9223372036854775808L; .19 abstract abstract void func (); .21
float float x4 = -3.402823e+38f; .32 synchronized synchronized (object) {…} .26
double double x = -1.79769313486231e+308; .33 native native int func (); .05
transient public transient int i; .07
for for (int i=0; i<10; i++) {…} .63 volatile public volatile int i; 0
do do {…} while (i<10); .01
while while (i<10) {…} .22 class class A {…} .86
if if (i==10) {…} 3.41 interface interface I {…} .07
else if (i<0) {…}
else .92 extends class B extends A {…} .44
else {…} Classes
implements class B implements I {…} .22
switch switch (i) { .08
case 1: … package package de.falkhausen.util; .36
case break; .44
default:… import import java.awt.*; 1.40
default } .05
Control flow
break break label; .28
(true) boolean isOpen = true; .45
continue continue label; .03
(false) boolean isOpen = false; .53
return return i; 2.91
(null) Object obj = null; 2.00
try try { .30
… void void func () {…} 2.15
throw throw new MyException (); .38 Miscellaneous
… this this.x = x; 1.16
catch } .34
catch (MyException ex) {…} new Object obj = new Object (); 2.71
finally finally {…} .01 super super ("text"); .43
throws void func () throws MyException {…} .53 instanceof
if (o instanceof String)
.25
String s = (String) o;

Reserved/New const, goto / strictfp, assert 0

You might also like