Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Java
(view source)
Revision as of 07:54, 29 April 2022
386 bytes added
,
07:54, 29 April 2022
m
→Strings
Line 3:
Line 3:
===With apt===
===With apt===
<nowiki>sudo apt-add-repository ppa:webupd8team/java
<nowiki>sudo apt-add-repository ppa:webupd8team/java
−
sudo apt-get update
+
sudo apt-get update
−
sudo apt-get install oracle-java8-installer</nowiki>
+
sudo apt-get install oracle-java8-installer</nowiki>
Also ensure your JAVA_HOME variable has been set to:
Also ensure your JAVA_HOME variable has been set to:
Line 79:
Line 79:
System.out.println("My integer is: " + myInt);
System.out.println("My integer is: " + myInt);
}
}
−
}</source>
+
}</source>
<syntaxhighlight lang="java">
+
//Java 11
+
" ".isBlank(); // --> true
+
" lr ".strip(); //Java 11
+
" lr ".stripLeading().replace(" ", "@");
+
" lr ".stripTrailing().replace(" ", "@");
+
"line1\nline2\nline3".lines().forEach(System.out::println);
+
+
//Java 12
+
"UPPER".transform(s -> s.substring(2));
+
+
//Java 13
+
"My name is %s. My age is %d".formatted("Rafa", 40);
+
+
//Java 14
+
+
+
</syntaxhighlight>
+
==Enum type==
==Enum type==
See code example:<br />
See code example:<br />
Line 1,515:
Line 1,533:
<br />
<br />
−
== Predicate Not ==
+
==Predicate Not==
Java 11<syntaxhighlight lang="java">
Java 11<syntaxhighlight lang="java">
import java.util.List;
import java.util.List;
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version