diff options
| author | Paul Jungeblut <s_jungeb@i08pc56.atis-stud.uni-karlsruhe.de> | 2014-11-25 11:37:28 +0100 |
|---|---|---|
| committer | Paul Jungeblut <s_jungeb@i08pc56.atis-stud.uni-karlsruhe.de> | 2014-11-25 11:37:28 +0100 |
| commit | 7113e0921ad8c1592280ffee9445fab29e66fb7f (patch) | |
| tree | aae7af9617fa150d7bd75dbfeeea4a7a05845525 /java/java.tex | |
| parent | 584bf7d1f9b476a09a011a33c0768cc7e03bc8e6 (diff) | |
Was passiert, wenn wir Java begegnen
Diffstat (limited to 'java/java.tex')
| -rw-r--r-- | java/java.tex | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/java/java.tex b/java/java.tex new file mode 100644 index 0000000..469fcc1 --- /dev/null +++ b/java/java.tex @@ -0,0 +1,42 @@ +\section{Java} + +\subsection{Introduction} + +\begin{itemize} +\item Compilen: \lstinline{javac main.java} +\item Ausführen: \lstinline{java main < sample.in} +\item Einlesen: +\lstset{language=Java} +\begin{lstlisting} +Scanner in = new Scanner(System.in); //java.util.Scanner +String line = in.nextLine(); //reads the next line of the input +int num = in.nextInt(); //reads the next token of the input as an int +double num2 = in.nextDouble(); //reads the next token of the input as a double +\end{lstlisting} +\end{itemize} + +\subsection{BigInteger} +Hier ein kleiner überblick über die Methoden der Klasse BigInteger: +\begin{lstlisting} +//Returns this +,*,/,- val +BigInteger add(BigInteger val), multiply(BigInteger val), divide(BigInteger val), substract(BigInteger val) + +//Returns this\(^e\) +BigInteger pow(BigInteger e) + +//Bit-Operations +BigInteger and(BigInteger val), or(BigInteger val), xor(BigInteger val), not(), shiftLeft(int n), shiftRight(int n) + +//Returns the greatest common divisor of abs(this) and abs(val) +BigInteger gcd(BigInteger val) + +//Returns this mod m, this\(^{-1}\) mod m, this\(^e\) mod m +BigInteger mod(BigInteger m), modInverse(BigInteger m), modPow(BigInteger e, BigInteger m) + +//Returns the next number that is greater than this and that is probably a prime. +BigInteger nextProbablePrime() + +//Converting BigInteger. Attention: If the BigInteger is to big the lowest bits were choosen which fits into the converted data-type. +int intValue(), long longValue(), float floatValue(), double doubleValue() +\end{lstlisting} +\lstset{language=C++}
\ No newline at end of file |
