Search

You can find the results of your search below. If you didn't find what you were looking for, you can create or edit the page named after your query with the appropriate button.

Results


Handling Compiler Warnings: 20 Hits
mpiler Warnings ====== ===== Unchecked Cast using Class.forName ===== I have a codebase that uses the the... xy Pattern]] to allow dynamic lookups of delegate classnames at runtime. Typically, I use a utility method to retrieve the delegate class name from my database using a key, and then use the ''Class.forName'' method to retrieve the class object. Here's a very simple example, without the utility function
Java Class Loaders: 10 Hits
====== Java Class Loaders ====== Most java programs don't need to manipulate the JVM class loader. But t... re are circumstances when a program needs to load classes in a non-standard way. For example: classes c... e encrypted on disk. In either case, the default class loader must be replaced with a special-purpose on... esired behavior. So, how do we implement our own classloader? ===== Implementing a Class Loader =====
Experiment #3: 8 Hits
Songs. Here are the simplified versions of those classes: <code java 1> /*..package and import statements here..*/ public class Artist { private transient Nodeid neoid; @neo(index=true) private ... /*..package and import statements here..*/ public class Album { private transient Nodeid neoid; @... /*..package and import statements here..*/ public class Song { private transient Nodeid neoid; @n
The Dog Page: 4 Hits
So we enrolled in [[http://training.petsmart.com/classes_beginner.shtml|Beginner Education]] classes at ... on Banfield Plans]]. We started taking obedience classes (they call them "puppy classes") at PetSmart. ... got a treat instead. This seemed fairly easy in class. Obedience topic #6: "Drop it". Similar to the... o learn, so they merit more time. A few of our classmates have dropped out by now. Sad situation, but
Formatting Syntax: 4 Hits
/nowiki>''. <code java> /** * The HelloWorldApp class implements an application that * simply displays "Hello World!" to the standard output. */ class HelloWorldApp { public static void main(String... enerated inline HTML)'; </php> <PHP> echo '<table class="inline"><tr><td>The same, but inside a block lev... ; echo '(inline HTML)'; </php> <PHP> echo '<table class="inline"><tr><td>The same, but inside a block lev
Thread Example: 3 Hits
l need to add a package statement and located the class in the appropriate directory in your classpath. ... t java.text.SimpleDateFormat; import java.util.*; class threads { public static String[] names = { "... new T1(i, names[i]); t.start(); } } } class T1 extends Thread { public int threadID =
Java Tutorials: 3 Hits
let]] * [[assert_example|Assert Example]] * [[class_loaders|Class Loaders]] ====== Java Resources =
XML Schema Validator: 3 Hits
couldn't find anything, so I wrote my own. This class parses an XML file and validates it against its D... and that the document matches its DTD. It uses classes from the [[http://xerces.apache.org/|Apache Xer... mport org.xml.sax.*; import javax.xml.parsers.*; class XMLValidator implements ErrorHandler { private b... ing filename) { try { // setup SAX parser Class.forName("org.apache.xerces.parsers.SAXParser");
Assert example: 3 Hits
====== Assert example ====== Assertions are a debated topic in Java. They were implemented in such a way that they throw JVM Errors rather than Exceptions. This means they halt your program at the point of the assertion failure. Here is an example: <code java> package com.freyer.test; public class AssertionTest { /** * @param args * No args for this example */ public static void main(String[] args) { String s = null; // test the proper behavior of the method say("hello"); // test the improper behavior of the method say(s); } private static void say(String s) { assert s != null : "string is null"; System.out.println(s); } } </code> In this code, the line containing ''say("hello");'' will cause the assertion in the ''say'' method to be true and allow the program to function normally. But the line containing ''say(s);'' will cause the assertion to fail because variable ''s'' is null. So how can you use assertions in a production application without possibly halting it when something goes wrong? With a JVM flag. The JVM provides a means to enable and disable assertions, as follows: java -disableassertions com.freyer.test.AssertionTest --> disable all assertions java -da com.freyer.test.AssertionTest --> short-hand java -da:com.freyer.test... com.freyer.test.AssertionTest --> disable assertions by package name java -da:AssertionTest com.freyer.test.AssertionTest --> disable assertions by class name or java -enableassertions com.freyer.test.AssertionTest --> enable all assertions java -ea com.freyer.test.AssertionTest --> short-hand java -ea:com.freyer.test... com.freyer.test.AssertionTest --> enable assertions by package name java -ea:AssertionTest com.freyer.test.AssertionTest --> enable assertions by class name This syntax allows you to active and deactivate assertions globally, by package, or by classname. For greater details, see the JVM docs.
JavaOne 2008, Day 1: 2 Hits
javafxc, javafx, javafxdoc * "Time" is a first-class function, so KeyFrame animation isi provided to m... s to the JVM * scripting languages become first-class citizens in the JVM * annotations become more p
DateTools: 2 Hits
l calendar building tools. Written in 2001, this class provides mathematical information to calendar sys... ava.util.Date; import java.util.Calendar; public class DateTools { public static String days[] =
Experiment #2: 2 Hits
t org.neo4j.kernel.EmbeddedGraphDatabase; public class Neo4JPerformanceExercise { //static constant... ivate static final String ZIP_KEY = "zip"; //class variables private static GraphDatabaseService
Visual Calendar Servlet: 2 Hits
is servlet depends on my [[technology:datetools]] class. <code java> /** * Insert the type's descriptio... o.*; import java.util.*; import DateTools; public class CFWebCalendar extends javax.servlet.http.HttpServ
How Long has a Process Been Alive?: 1 Hits
with a user-defined format: ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm The im
JavaFX Home: 1 Hits
 
Recent changes RSS feed Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki