Click me
Transcribed

Java Cheat Sheet

O Java AssignmentHelp.net Java CHEAT SHEET Basic code structure text file named HelloWorld.java пате main() method public class HellWorld { public static void main(String[] args) { System.out.print("Hello, World"); System.out.println(); statements body Input and output use any editor to create your program type javac HelloWorld.java to compile your program type java HelloWorld to compile your program editor HelloWorld.java compiler >Helloworld.class JVM "Hello, World" computer-language version of your program your program output (a text file) Date types type set of values common operators sample literal values int intergers + - * / % 99 -12 2147483647 double floating-point numbers + - * / 3.14 -2.5 6.022e23 boolean boolean values && || ! true false char characters 'A' '1' '%' '/n' String sequence of characters "АВ" "Не1lo" "2.5" Assignment status Booleans declaration statement values true or false variable name. int a, b; - literal 1234 literals true false a assignment 99; statement operations and or not int c = a + b; operators && || combined declaration and assignment statement Comparison op теаning true false equal 2 == 2 2 == 3 == ! = not equal 3 != 2 2 != 2 く less than 2 < 13 2 < 2 less than or equal 2 <= 2 3 <= 2 く = greater than 13 > 2 2 > 13 >= greater than or equal 3 >= 2 2 >= 3 Loops initialization is a seperate statement loop continuation condition initialization another a loop control variable variable in a declare and initialize loop continuation int v = 1; seperate statement condition increment while ( v <= N/2 ) int v = 1; braces are optional when body is a single statement for (int i = 0; i <= N; i++ ) v = 2*v; { System.out.println(i + v = 2*v; + v); body body Functions method signature argument argument type return type variable пате public static double sqrt ( doublec) { if (c < 0) return Double.NaN; double err = local variables le-15; double t = c; while (Math.abs (t - c/t) > err * t) t = (c/t + t) / 2.0; return t; method body call on another method return statement References : http://introcs.cs.princeton.edu/java/11cheatsheet/ http://mindprod.com/jgloss/jcheat.html/ http://www.javaassignmenthelp.net/

Java Cheat Sheet

shared by davidcameron23 on Nov 16
6,957 views
10 shares
2 comments
Java cheat sheet supplies you with a list of the most important Java functions and explains Java syntax. For professional Java help don't hesitate to turn to http://www.javaassignmenthelp.net/

Publisher

Hardly

Tags

None.

Category

Technology
Did you work on this visual? Claim credit!

Get a Quote

Embed Code

For hosted site:

Click the code to copy

For wordpress.com:

Click the code to copy
Customize size