Tip Bank

DevX - Software Development Resource

Push Button Increments

Question: I have this declaration in init: pushButton1 = new Button(“0”). In the action class I try to increase the value from 0 through 9 every time I click the

DevX - Software Development Resource

Code Generates Null Pointer Exception

Question: If I have: class point { double x,y; } & import point; class test { public static void main(String args[]) { point[] P = new point[10]; P[0].x = 5;

DevX - Software Development Resource

Connecting to a database

Question: I noticed that there are 3 different types of connect properties for a session. What’s the difference? Answer: Every session has three different connect properties that are used at

DevX - Software Development Resource

Reading Text File From Server

Question: I know I can’t read files from a local machine through my browser, but I can’t seem to read a file off my originating server either. There’s a way

DevX - Software Development Resource

Writing a Factorial Method

Question: Can you help me complete the enclosed program? A “Factorial Method”must be written. /////// File: Factorial.java /////// class Factorial { /* put factorial method here */ public static void

DevX - Software Development Resource

repaint() and Consecutive Lines

Question: My applet draws lines. I click at the place where I want my line to start and then I click at the end of it. It draws a line