Benutzer-Werkzeuge

Webseiten-Werkzeuge


Seitenleiste

3D

INTERN

ADOBE

ARDUINO

BITBUCKET

DOCKER

C4D

GIT

HTML

IPHONE

JAVASCRIPT

JTL-SHOP

LARAVEL

MAGENTO2

MYSQL

PHP

PLESK

PROCESSING

PYTHON

SUITECRM

SEO

TRYTON

THUNDERBIRD / ICEDOVE / FossaMail

TYPO3

TYPO3: BACKEND

TYPO3: TYPOSCRIPT

UNIX

VLC

VVVV

WINDOWS

WINDOWS 10

WORDPRESS

XAMPP

XT:C 4 (Veyton)

processing-snippets

Processing (aka java) Snippets

DataTypes and Instantiation

// primitives:
//boolean, byte, short, int, long, float, double, char
//http://www.cafeaulait.org/course/week2/02.html
 
 
// declare a List
import java.util.List;
import java.util.Arrays;
String[] favorites = {"EJB", "JPA", "GlassFish"};
 
// iterate over it using for each
for (String i : favorites) {
      System.out.println("An element in the list: " + i);
    }
 

check DataType of Object

//have a variable
String testingVar = "a simple test"
 
//run a test on it
test(testingVar);
 
/*
* Util: Check Datatypes
*
* the functions have the same name,
* the correct one will be used,
* its called overloading a method.
* http://www.daniweb.com/software-development/java/threads/263868/testing-data-type#post1145069
*/
public void test(String obj) {
  System.out.println("obj is a string");
}
public void test(Integer obj) {
  System.out.println("obj is an Integer");
}
public void test(Object obj) {
  System.out.println("obj is not a string or integer, it is a "+obj.getClass());
}
processing-snippets.txt · Zuletzt geändert: 2014/08/18 11:55 von admin