summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorPaul Jungeblut <paul.jungeblut@gmail.com>2016-05-24 18:43:52 +0200
committerPaul Jungeblut <paul.jungeblut@gmail.com>2016-05-24 18:43:52 +0200
commitbd927374a755c95eb703aa77eb7f6fe9fe090dc5 (patch)
treeda03fa0b433f5d5454debd2449080a975f940506 /java
parent66dee0f5f05a135b949910a9156b399c5408ba3b (diff)
String fixes and STL-Debug flag.
Diffstat (limited to 'java')
-rw-r--r--java/java.tex28
1 files changed, 14 insertions, 14 deletions
diff --git a/java/java.tex b/java/java.tex
index d9c3a75..f52e733 100644
--- a/java/java.tex
+++ b/java/java.tex
@@ -7,43 +7,43 @@
\item Compilen: \lstinline{javac main.java}
\item Ausführen: \lstinline{java main < sample.in}
\item Eingabe:
+\lstinline{Scanner} ist sehr langsam. Bei großen Eingaben muss ein Buffered Reader verwendet werden.
\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
+Scanner in = new Scanner(System.in); // java.util.Scanner
+String line = in.nextLine(); // Liest die nächste Zeile.
+int num = in.nextInt(); // Liest das nächste Token als int.
+double num2 = in.nextDouble(); // Liest das nächste Token als double.
\end{lstlisting}
\item Ausgabe:
\begin{lstlisting}
-//Ausgabe in StringBuilder schreiben und am Ende alles auf einmal ausgeben -> viel schneller
-StringBuilder sb = new StringBuilder(); //java.lang.StringBuilder
+// Ausgabe in StringBuilder schreiben und am Ende alles auf einmal ausgeben. -> Viel schneller.
+StringBuilder sb = new StringBuilder(); // java.lang.StringBuilder
sb.append("Hallo Welt");
System.out.print(sb.toString());
\end{lstlisting}
\end{itemize}
\subsection{BigInteger}
-Hier ein kleiner überblick über die Methoden der Klasse BigInteger:
\begin{lstlisting}
-//Returns this +,*,/,- val
+// Berechnet this +,*,/,- val.
BigInteger add(BigInteger val), multiply(BigInteger val), divide(BigInteger val), substract(BigInteger val)
-//Returns this^e
+// Berechnet this^e.
BigInteger pow(BigInteger e)
-//Bit-Operations
+// Bit-Operationen.
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)
+// Berechnet den ggT von abs(this) und abs(val).
BigInteger gcd(BigInteger val)
-//Returns this mod m, this^-1 mod m, this^e mod m
+// Berechnet 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.
+// Berechnet die nächste Zahl, die größer und wahrscheinlich prim ist.
BigInteger nextProbablePrime()
-//Converting BigInteger. Attention: If the BigInteger is to big the lowest bits were choosen which fits into the converted data-type.
+// Berechnet int/long/float/double-Wert. Ist die Zahl zu großen werden die niedrigsten Bits konvertiert.
int intValue(), long longValue(), float floatValue(), double doubleValue()
\end{lstlisting}
\lstset{language=C++} \ No newline at end of file