javaworld.com

Upvotes received0
Downvotes received0
Karma:0 (upvotes-downvotes)



0 earned Badges

No badges were found



Definitions (21)

1

0 Thumbs up   0 Thumbs down

listing 1. evaluating mathematical expressions with repl


$ bash ./scripts/run.sh | Welcome to JShell -- Version 0.710 | Type /help for help -> Math.sqrt( 144.0f ); | Expression value is: 12.0 | assigned to temporary variable $1 of type double -> $1 + 100; | Expression value is: 112.0 | assigned to temporary variable $2 of type double -> /vars | double $1 = 12.0 | double $2 = 112.0 -> double v [..]
Source: javaworld.com (offline)

2

0 Thumbs up   0 Thumbs down

listing 2. calculate the fibonacci sequence


$ bash ./scripts/run.sh | Welcome to JShell -- Version 0.710 | Type /help for help -> long fibonacci(long number) { >> if ((number == 0) || (number == 1)) >> return number; >> else >> return fibonacci(number - 1) + fibonacci(number - 2); >> } | Added method fibonacci(long) -> /methods | fibonacci (long)long -> [..]
Source: javaworld.com (offline)

3

0 Thumbs up   0 Thumbs down

listing 3. repl for re-use


> long fibonacci(long number) { >> return 1; >> } | Modified method fibonacci(long) -> for( long i : array ) { System.out.println(fibonacci( i )); } 1 1 1 1 1 1 1
Source: javaworld.com (offline)

4

0 Thumbs up   0 Thumbs down

listing 4. dynamic class definition


MacOSX:repl tobrien$ bash ./scripts/run.sh | Welcome to JShell -- Version 0.710 | Type /help for help -> class Person { >> public String name; >> public int age; >> public String description; >> >> public Person( String name, int age, String description ) { >> this.name = name; >> this.age = age; >> [..]
Source: javaworld.com (offline)

5

0 Thumbs up   0 Thumbs down

listing 5. know your /history


> /history class Person { public String name; public int age; public String description; public Person( String name, int age, String description ) { this.name = name; this.age = age; this.description = description; } public String toString() { return this.name; } } Person p1 = new Person( "Tom", 4, "Likes Spiderman" ); Person [..]
Source: javaworld.com (offline)

6

0 Thumbs up   0 Thumbs down

listing 6. modifying person


> /l 1 : class Person { public String name; public int age; public String description; public Person( String name, int age, String description ) { this.name = name; this.age = age; this.description = description; } public String toString() { return this.name; } } 2 : Person p1 = new Person( "Tom", 4, "Likes Spiderman" ); 3 : [..]
Source: javaworld.com (offline)

7

0 Thumbs up   0 Thumbs down

dom


DOM (Document Object Model) is the standard in-memory XML representation. DOM proves flexible in that you can access any document bits whenever you want, but it can be memory hungry, so developers commonly use it to build client applications where memory is not an issue. DOM suffers from being old, language-neutral (so it is a lowest common denomin [..]
Source: javaworld.com (offline)

8

0 Thumbs up   0 Thumbs down

sax


SAX (Simple API for XML) differs from DOM in that it is event-driven: the document flashes before your eyes while the parser notifies you of elements and attributes. You pick out the bits you want as it goes by. SAX is lightweight and simple, but working out your location in a document can be challenging. Developers generally use SAX in server appl [..]
Source: javaworld.com (offline)

9

0 Thumbs up   0 Thumbs down

jaxp


JAXP (Java API for XML Parsing) is not really a technology separate from DOM or SAX, but simply an extension to both that makes them easier to use in Java. Both DOM and SAX are language-neutral, so neither answers questions like, "How do we create a parser." JAXP answers the creation question and is a standard API for XSLT (Extensible Sty [..]
Source: javaworld.com (offline)

10

0 Thumbs up   0 Thumbs down

jdom


To those struggling with DOM, JDOM will seem like a breath of fresh air. JDOM fixes some of DOM's more arcane areas. For example, unlike with DOM, in JDOM elements and attributes are objects, so you can call new Element("name");
Source: javaworld.com (offline)


To view all 21 definitions, please sign in.