many articles have been written on applet development and the use of java for bringing more interactivity to pages on the web. while this is a valid use of java, its equally well suited for developing more traditional standalone or client/server applications that can run across multiple platforms. when java is used to develop each of the tiers of an n-tier client/server application, its cross-platform nature offers additional benefits, including scalability (independent of hardware platform), flexibility and vendor independence.
which jdk?
1. good programming practices 【程序编程相关:通过内部类的一个例子展示java中的可访】 one advantage of application development over applet development is that you have much more control over which version of the jdk to use. if youre developing a small application for deployment in the next couple of months, you should probably use jdk 1.1. however, you may want to consider using jdk 1.2 (also known as java 2 sdk, version 1.2) for slightly longer-term projects. it offers many new features and improved performance.whichever version you decide to use, be sure to bundle the appropriate java runtime environment when you distribute your application.
application development, with its more relaxed security model, allows lower-level access to the operating system. this access, however, can result in your applications becoming platform-specific. in this article ill look at five primary areas you should pay special attention to when developing cross-platform java applications: 【推荐阅读:Java 2 引用类使用指南】
3. read/write files 【扩展信息:字节码如何防止内存错误及提高代码质量】 2. os differences and limitations 4. graphical user interface design 5. other issuesgood programming practices
depend only on the core apis. the java core api forms a standard foundation of classes that all java virtual machines must implement to be considered "standard java."if you use any third-party class libraries, youll need to distribute their runtime versions (which may require a separate license). its also recommended that you verify that these third-party libraries make use of the core java api only and dont use any native calls. otherwise the code you write may be cross-platform. however, since your code depends on a third-party product thats not cross-platform, your resulting application wont be cross-platform either.
enable all compiler warnings.
by default, the java compiler generates warnings for code it... 下一页