if (numberInput % 2 != 0)System.out.println (numberInput + " is not even.");if (numberInput % 2 == 0)System.out.println (numberInput + " is even.");if (numberInput % 3 == 0)System.out.println (numberInput + " is divisible by 3.");if (numberInput % 3 != 0)System.out.println (numberInput + " is ...
236 byte By
nextOnea at 2007-10-1 0:45:38
HelloWhat does at compile/execution time exactly mean?What kind of processes are called at compile time (respectively at execution time)?If anyone could give me unambigous information about that.thanks
186 byte By
wash_ema at 2007-10-1 0:45:43
What creates a NullPointerException? I have a program converting gallons to quarts , pint, gills, liters, and fluid. Whenever i run the code it gives me the NullPointer Exception.
677 byte By
tyronta at 2007-10-1 0:45:49
i am current stuck on a project i am developing for my university course. i have make a simple holiday booking class which i have done view here http://www.geocities.com/tyront01/holidayRecord.txtthe problem is i have to now make a second class that will take all this information into a ...
hi im creating a calendar in java, i have a class which declares the CalendarData type (which contains the date as ints, a description in the form of a string a toString to format output and a load of get and change methods), i then make an array of multiple instamces of this class ...
2953 byte By
Taldosa at 2007-10-1 0:46:24
Greetings, As a newbie, I am sure you all have been in my place at one time or another so I will skip right to the meat of what I am trying to do.I originally started out with GridBagLayout() and placing all my code in the main function declaration but that has it's limits.I am trying to find ...
I am storing some field in chinese. (databse MSSQL - field type is nvarchar). When i store it i can not see as chinese character but as some sort of unicode characters. (unreadable). When i try to pick it up from database and display in jsp page - i get it but same unicode format ...
532 byte By
Lyot_bea at 2007-10-1 0:47:50
I know there haven been posted already a lot of messages in this regard.But none of them really answered my question.I'm a student and have to write a program in Java for a company. This program will be sold.My questions:- Are those free Java-editors really free even if you use them for a ...
187 byte By
gw@balaa at 2007-10-1 0:48:04
Instead of doing this:ArrayList a = new ArrayList();i can useList a = new ArrayList();can anyone give the technical advantages on that!!!! -jaban
what is the difference between process and thread ?
I'm developping a TimeTable-Application for a J2EE-Server.My central SessionBean has a method createTimeTableEntry(). Inside this method I do several database accesses.Therefore it is necessary that at any time only one client can call createTimeTableEntry(). So I`m now looking for something ...
983 byte By
mr_nicka at 2007-10-1 0:48:39
Hello, I'm new to Java and having problems splitting a program into packages.I have 6 files, 5 containing class definitions and sub classes, and one which holds the main method. They compile and run fine when all in the same directory. In an effort to try out packages, I copied the 5 .class ...
I'm making some kind of game where a map draws itself as a fixed number of tiles...some tiles are destroyable, and when destroyed, they turn into another tile (basicly, the image and some parameters changes)also, a tile can have another tile above or belownow what I'm trying to do is to ...
I've created a GUI with a couple of check boxes. I want one check box to call a method when selected and a different method when deselected and the same with the other check box but obviously with different methods. Had a look at the java documentation but couldn't work out. any ideas?
Okay, I was just writing a method that sorts an array of ints with very, very, quick runtime- much better than Quicksort and even Radix.public static int[] sort(int[] a){int[] sorted = new int[getMax(a)+1];for(int i = 0; i < a.length; i++)sorted[a] = a; //assigns the value to the ...
I wrote an applet using swing components that is running fine in applet viewer but when I try to use it in my browser it won't work. I've tried different solutions to the problem but still it won't work. I've downloaded a html converter from java.sun.com since I heard something about that ...
hi,how can i find out the the maximum number connections a JVM can have? is there such a limit? my co-worker thinks there is, and I never read about it.or is this an OS level limit? thanks
72 byte By
Chrismca at 2007-10-1 0:50:48
What program would I use as an editor for the .java source files?
Hi,excuse what may seem a dumb question but how can I verify the version of the SDK 5.0 download. I want to put in in the path variable for win XP.This is the installation file downloaded: jdk-1_5_0-windows-i586.exe*******************the documentation says...Note: For any text on this page ...
Hi my name is Spilo.I have experiance in php scripting and have decided to learn Java.I downloaded j2sdk-1_4_2_06-windows-i586-p.exe and netbeans-4_0-bin-windows.exe I installed them an it seems to beworking fine.. i am on my way.I have a question though.. I think I have Standard Edition.. what ...
376 byte By
zachvaca at 2007-10-1 0:50:57
I have a program where I want someone to enter the password, and when they press enter it does stuff. The problem is I can't check if they pressed enter because the getKeyCode() method in KeyEvent always returns 0 on a JPasswordField. Is there a way I could check for enter and get around that? ...
i have a file named test.txt like this.12 32113 32132111 42110 4211 42536 32143 42141 465434 54355 543531 54353 7654im trying to write a class that has a method which returns a String[12][2] .The String should be like this:String[0][0] = 12String[0][1] = 321String[1][0] = 13String[1][1] = ...
1977 byte By
nextOnea at 2007-10-1 0:51:23
HiAs you guess i 'am a newbie!I don't understand Inner Classes, particulary members(methods & fields) that an Inner method is able to manipulate.So I know that the methods of an Inner class (respectively Outer Class) instance can access members (private or public) of an instance of the ...
RequestDispatcher rd = getServletContext().getContext("/").getRequestDispatcher(strURL);what RequestDispatcher does ?(// does it merely forwards ? )can strURL could bea directory structure ? (like... com\user\some_jsp.jsp).i am not comfortable bcoz of all those nested methods . and ultimately ...
I am using JDK 1.2 and when I try to compile HelloWorld. Java using javac HelloWorld.java its pops up a window that says javac.exe has encountered a problem and needs to close. Any ideas on what the problem might be. Thanks!
336 byte By
David04a at 2007-10-1 0:52:16
Anyone knows any exam example for the certification (for the J2SE)?It would be good if it had the corrections.I saw this site http://www.javaprepare.com but it don't has solutions (I think).If there is any other kind of test that I can do to know what I really know of java, please ...
Hey, I'm fairly new to programming, and was trying to put together an app that would read all the .gif files from a directory, and put them together into one spritesheet, based on instructions from the command line. The method that I'm trying to use is to load all the images, use a Graphics ...
I need to make something so that if int x is even then boolean y will be true. But I cannot find how to see if something is even? I tried something like if (x / 2 == int) lol but that does not work. So what is the ...
2078 byte By
markjma at 2007-10-1 0:52:27
Java SecurityLassi Lehto Helsinki University of Technology Telecommunications Software and Multimedia Laboratory http://www.tml.hut.fi/Opinnot/Tik-110.551/1997/Java-Security.html...by using Sun Java, its loaded executable code run on its client's local CPU. If you "TRUST" Sun Microsystems, Inc ...
I just installed JDK1.5.0 when to javac Hello.java I get this message;'JAVAC' is not recognized as an internal or external command,operable program or batch file.Can anyone help?Thanks!
Anyone heard of this famous riddle?Does anyone have the code written out for it for java or have any suggestions for writing a program that rolls 5 dice at random and then asks the user to input a guess based on the numbers to try and solve the pattern seen......NOTE: If you have no idea what ...
799 byte By
brutusa at 2007-10-1 0:52:53
Hi,Please take a look at the following simple program.public class C {static boolean a,b,c;public static void main(String[] args){boolean x= (a=true) || (b=true) && (c=true);System.out.print(a+","+b+","+ c);}}The output of this program is true,false,false. Now this has got me all ...
Hello All:I have experience in C, C++,. C# and PHP. but I am a rank amatuer.Here is my question:-Basically, I'm curious to know if I can create a program that the user will click on, and it will 'install' itself to the desktop. User downloads my file. User clicks on my file User gets an icon ...
449 byte By
ch2nyoua at 2007-10-1 0:53:21
int i=-20;final int j=20;final int k=i;byte b1=j; //final value of j in range. No cast requiredbyte b2=(byte)i; //value of i not determinable. Cast requiredbyte b3=(byte)k; //final value of k not determinable. Cast requredI do not understand why the coversion i=-20 need the cast.byte is -127 - ...
Hi allI happen to learn that java is able to use break keyword.However, I read from some book saying that some java programmer doesn't recognize break key word...some do...depending on the person writing the codes.So, do java really accept break ...
668 byte By
sunlnka at 2007-10-1 0:53:45
Hi allI have a strange problem for which I cannot find an easy answer.I have a code similar to this:char c = '\u0002';String str = c + "blabla";In the original context of this code the str variable completely ignores the starting character c.However if I enter a dummy string in front of ...
whats up guys,im trying to write an applet that will display a pascal triangle as follows1: 12: 1 13: 1 2 14: 1 3 3 15: 1 4 6 4 16: 1 5 10 10 5 17: 1 6 15 20 15 6 18: 1 7 21 35 35 21 7 19: ...so when "6" is entered,"6: 1 5 10 10 5 1" is showni have a problem to define the general formula for ...
159 byte By
sunlnka at 2007-10-1 0:53:54
I have two stringsString a = "abc";String b = "def";from following two what is optimum?a.equals(b)a.compareTo(b) == 0
....Would like to hear some input from all concerned both from upper level proto level apprentice/entrepreneurs of Java ....and some tips to donate from your experieces, if you wish... Your time and input will greatly be appreciated by most who read your input......and comments...(Welcome to ...
class Quantity{// Quantity Constructor public Quantity(int qty[]){//System.out.println(qty.length);int dbQty[]= new int[qty.length];for(int i=0; i<qty.length; i++)dbQty= qty;}// To override toString convert Object.toString result to String// So that the result will not be [class ...
120 byte By
David04a at 2007-10-1 0:54:39
Can you tell me how can I pass information to a class A (non-static) from thread B (created from A)?Thanks
hey guysIve got that:import utility.In;public class Pascal {final static int SIZE = In.readInt("How many rows should be in the triangle? Number: ");//public static void main (String[] args) {int[][] pascal = new int[SIZE][]; // just the SIZE rows initiallyfor (int y = 0; y < pascal.length; ...
I want to display one report on screen (in HTML form). The coding is in JSP. I am picking up some date from database and putting inside the HTML tags.I am having pagination. For each new page, header and footer need to be repeated and inside portion is in a loop depending upon pagesize / page ...
Hi all,I am looking for a starting point. I have jsut started a new job and will be responsible to assisting our clients with a java based pdm product we have purchased. My role is to provide technical advise on a variety of issues. We contract out any development work that is required ...
1410 byte By
ILinka at 2007-10-1 0:55:05
hi all.. I am new to java. I came across this example that didnt make sense to me and wondering if someone can explain it to me. It is about nested classes, specificly static member classes.In the code below under the method public void nonStaticMethod_1_1_1().the assignment statment int kk = k ...
In Unix, a new process is started with the fork() command.......but i knew process can be created by Process class(java)..... does it mean the process i create through Process class and by fork() command are completely different !!!But after all both of them are process!!............. ...
13276 byte By
quade13a at 2007-10-1 0:55:26
I am having a hard time adding a scroll box to a text area where I will be displaying a loan table. Only the top arrows appear in my box the bottom arrow is off the screen, which makes scolling the text down a little difficult. I can not figure out how to size my panel so it shows both top and ...
780 byte By
ch2nyoua at 2007-10-1 0:56:25
The increment and decrement operators can be applied to operands of char, byte and short datatypes as well. In these cases, both binary numeric promotion and an implicit narrowing conversion are performed to achieve the side-effect of modifying the value of the operand. In the example below, ...
Does the Java API have any image handling capibilities embedded?For example, can you do OCR zoning?If it does have these capabilities, which package?
55 byte By
jmyrla at 2007-10-1 0:56:52
what are the benifits compared to passing arrays