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

Java Programming Cheat Sheet: by Via

This document provides a cheat sheet on basic Java programming concepts including: 1) Data types in Java such as byte, short, int, long, boolean, char, float, and double. 2) Key object-oriented programming concepts like class, object, and package. 3) Common functions like System.out.println() and charAt(). 4) An example of a swap method that exchanges elements in an integer array.

Uploaded by

tarik marrakech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views

Java Programming Cheat Sheet: by Via

This document provides a cheat sheet on basic Java programming concepts including: 1) Data types in Java such as byte, short, int, long, boolean, char, float, and double. 2) Key object-oriented programming concepts like class, object, and package. 3) Common functions like System.out.println() and charAt(). 4) An example of a swap method that exchanges elements in an integer array.

Uploaded by

tarik marrakech
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

java programming Cheat Sheet

by ppinkyy via cheatography.com/25758/cs/8968/

data types object

byte 8 bits class a blue print for an object

shoryt 16 bits object an instance of a class

int 32 bits package Organi​zation of a class

long 64 bits
Vocab
boolean bit

char 16 bits unicode Program Running program


Execution
float 32 bits decimal
Java Bytecodes the instru​​ction set of the Java virtual machine.
double 64 bits decimal
Java Virtual an abstract computing machine that enables a
Machine (JVM) computer to run a Java program.
Function

System.ou​​t.p​​r​int() print in the same line

System.ou​t.p​rin​tln() print in the different line

public static modifier

charAT() Return the character at the specified index

Boolean True or False

Swap

Public class Main {


​ ​ ​ ​public static void swap(int[] list, int e1, int
e2){
​ ​ int temp;
​ ​ ​ ​ ​ ​ ​ temp = list[e1];
​ ​ ​ ​ ​ ​ ​ temp = list[e2];
​ ​ ​ ​ ​ ​ ​ ​lis​t[e2] = list[e1];
​ ​ ​ ​ ​ ​ ​ ​lis​t[e1] = temp;
​ ​ ​ ​ ​ ​ ​ for (int i : list){
​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​ ​Sys​tem.ou​t.p​rin​tln(i);
​ ​ ​ ​ ​ ​ ​ }
​ ​ ​ }
​ ​ ​ ​public static void main(S​tring[] args) {
​ ​ ​ ​ ​ ​ ​ ​int[] mylist = new int[]{​1,2​,3,​4,5};
​ ​ ​ ​ ​ ​ ​ ​swa​p(m​ylist, 1, 2);
​ ​ ​ }
}

By ppinkyy Published 6th September, 2016. Sponsored by CrosswordCheats.com


cheatography.com/ppinkyy/ Last updated 6th September, 2016. Learn to solve cryptic crosswords!
Page 1 of 1. http://crosswordcheats.com

You might also like