mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
Some more small changes that don't affect semantics.
This commit is contained in:
parent
933f0a461d
commit
b72c575c04
@ -31,17 +31,17 @@ import java.security.*;
|
|||||||
// the file.
|
// the file.
|
||||||
public class LearnJava {
|
public class LearnJava {
|
||||||
|
|
||||||
// A program must have a main method as an entry point
|
// A program must have a main method as an entry point.
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
|
|
||||||
// Use System.out.println to print lines
|
// Use System.out.println() to print lines.
|
||||||
System.out.println("Hello World!");
|
System.out.println("Hello World!");
|
||||||
System.out.println(
|
System.out.println(
|
||||||
"Integer: " + 10 +
|
"Integer: " + 10 +
|
||||||
" Double: " + 3.14 +
|
" Double: " + 3.14 +
|
||||||
" Boolean: " + true);
|
" Boolean: " + true);
|
||||||
|
|
||||||
// To print without a newline, use System.out.print
|
// To print without a newline, use System.out.print().
|
||||||
System.out.print("Hello ");
|
System.out.print("Hello ");
|
||||||
System.out.print("World");
|
System.out.print("World");
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ public class LearnJava {
|
|||||||
// L is used to denote that this variable value is of type Long;
|
// L is used to denote that this variable value is of type Long;
|
||||||
// anything without is treated as integer by default.
|
// anything without is treated as integer by default.
|
||||||
|
|
||||||
// Note: Java has no unsigned types
|
// Note: Java has no unsigned types.
|
||||||
|
|
||||||
// Float - Single-precision 32-bit IEEE 754 Floating Point
|
// Float - Single-precision 32-bit IEEE 754 Floating Point
|
||||||
float fooFloat = 234.5f;
|
float fooFloat = 234.5f;
|
||||||
@ -86,7 +86,7 @@ public class LearnJava {
|
|||||||
// Char - A single 16-bit Unicode character
|
// Char - A single 16-bit Unicode character
|
||||||
char fooChar = 'A';
|
char fooChar = 'A';
|
||||||
|
|
||||||
// final variables can't be reassigned to another object
|
// final variables can't be reassigned to another object.
|
||||||
final int HOURS_I_WORK_PER_WEEK = 9001;
|
final int HOURS_I_WORK_PER_WEEK = 9001;
|
||||||
|
|
||||||
// Strings
|
// Strings
|
||||||
@ -123,7 +123,7 @@ public class LearnJava {
|
|||||||
|
|
||||||
// Others to check out
|
// Others to check out
|
||||||
// ArrayLists - Like arrays except more functionality is offered, and
|
// ArrayLists - Like arrays except more functionality is offered, and
|
||||||
// the size is mutable
|
// the size is mutable.
|
||||||
// LinkedLists - Implementation of doubly-linked list. All of the
|
// LinkedLists - Implementation of doubly-linked list. All of the
|
||||||
// operations perform as could be expected for a
|
// operations perform as could be expected for a
|
||||||
// doubly-linked list.
|
// doubly-linked list.
|
||||||
|
Loading…
Reference in New Issue
Block a user