32,204 Topics

Member Avatar for
Member Avatar for plasticfood

[CODE]public static void fun(int x){ System.out.println(x); x--; if(x > 0){ fun(x); } System.out.println("returning " + x); } [/CODE] in the main class: fun(5); [U]output:[/U] 5 4 3 2 1 returning 0 returning 1 returning 2 returning 3 returning 4 --------------------------------------- what i don't get is how the print statement is …

Member Avatar for jon.kiparsky
0
155
Member Avatar for livinlife79

import java.util.Scanner;// Import and use scanner import java.util.Arrays; public class Inventory3 { //begins execution of program public static void main(String[] args) { //create new object CD mycd = new CD(); //create and intialize array of CDs CD[] cdArray = new CD[3]; cdArray[0] = new CD("Rolling Stones",100,25,14.99); cdArray[1] = new CD("Pearl …

Member Avatar for jon.kiparsky
0
192
Member Avatar for spencer.kindt

Hey all, I've posted a few other threads and all the help has been so helpful... I have another assignment and I need some more help. For 9, I'm thinking that I should use a for loop and just do i-- for each time it runs through? After that just …

Member Avatar for jon.kiparsky
0
172
Member Avatar for StevoLord

Hi, I've got a basic javax.swing.Timer that I use to repeat itself to darken an image over and over again. This should give a fade out effect for the image however the delay on this is set to 0010 which should be so quick however it takes half a second. …

Member Avatar for mKorbel
0
130
Member Avatar for DARK_BYTE

HI I am currently doing my final year project and I need to build an algorithm visualization tool(with user defined algorithm animation). The user defined animation takes place as follows: 1. The user can open a text editor in the GUI and type his/her user-defined algo in java 2. When …

0
66
Member Avatar for raul8
Member Avatar for pcvrx660

The assignment I am doing is almost complete but the while loop doesn't exit. package lessons; import java.util.Scanner; public class Chp4417 { public void determineMileage() { Scanner input = new Scanner(System.in); int miles, gallons; //read in the inputs. int counter = 0; // counter int totalGallons = 0; //calculate total …

Member Avatar for Buffalo101
0
146
Member Avatar for javanoob21

Ok, I'm very bad at java and I was wondering if anyone could explain to me how I would begin to approach this? This problem involves a system which processes medical insurance forms. The forms have a three byte code which starts with a first character alpha code of a …

Member Avatar for JamesCherrill
0
124
Member Avatar for aman rathi

i am very beginner to java getting error in below code [CODE]class forloop{ public static void main(string args[]){ int x; for(x=0;x<10;x=x+1) system.out.println("this is x:"+x); } }[/CODE] error : cannot read :forloop.java i error please help me

Member Avatar for aman rathi
0
176
Member Avatar for sfrider0

Is it possible to display a web page inside of a java applet? It would work similar to a frame using html. I guess it would be like a mini web browser inside of a web browser.

0
82
Member Avatar for montalbano80

I am having some trouble with my Java program. I completed a PoolVolume class project and am trying to add a login and password page before the PoolVolume class starts. I completed the login and password script but can not get the login page to access the next class page. …

Member Avatar for montalbano80
0
190
Member Avatar for TheOnlyNemesis

I have got further into my program and am at the last hurdle, i am using String.split to split InetAddress IP using getInetAddress. so IP is storing the host name and ip address which is split by a /. I am trying to split the string using string.split but when …

Member Avatar for ztini
0
139
Member Avatar for musikluver4

How do you allow an action to be performed when a user selects a specific item on a Choice() component? For example: If a user selects a specific item on the Choice() component, I want a JTextField() to be set to .setVisible(true) and appear. Anyone?

Member Avatar for musikluver4
0
82
Member Avatar for Neversleepin

Hi, i'm trying to copy and paste 12 last modified files from a folder to another one. my code is working but it gets every files in the folder with any dates. any help will be appreciated. Thank you very much [CODE]import java.io.*; import java.text.*; import java.util.*; class FileFilterDateIntervalUtils implements …

Member Avatar for Neversleepin
0
245
Member Avatar for addlou

Write a method called newTest(String input) that accepts one input. Input is a string stored as a variable called input and returns nothing back. Method should test to see if the string’s first and last characters are the same and should disregard case. Use a string method that converts to …

Member Avatar for mKorbel
0
160
Member Avatar for spencer.kindt

I'm in a beginner Java class at school and I'm having a hard time getting this to work. Most of our problems require JOptionPane and for or while loops and if statements and those kinds of things... For #6, I'm thinking about using a while loop and a for loop …

Member Avatar for spencer.kindt
0
178
Member Avatar for oliminator123

Hi, new here but would appreciate some sort of help. I have to create a program that takes 20 random strings from a string array of 40 words I made, and store them into a new string array called second. Directions: -create random # generator -generate random # between 0 …

Member Avatar for oliminator123
0
812
Member Avatar for priyamehta

Hello, I am new to programming and I have to write a program to perform a fast search on address book. The address book records are in csv file and contains 4 fields - first name, last name, phone number and company name. My problems are - 1. How do …

Member Avatar for priyamehta
0
322
Member Avatar for kukuruku

Hi everybody,I have java exam tomorrow and one of the question is going to be tracing code,unfortunately I am not vary good at that.My question is if anybody knows web site on the net with similar questions and answers Thanks yesterday the professor give us this example [CODE]public class A …

0
57
Member Avatar for addlou

I need help showing me where I went wrong. Given problem is. Print to System.out a new string composed of every alternate character in sentence starting with the first. Use a loop to go through a string and retrieve characters from alternate index positions. Append these characters to another string …

Member Avatar for addlou
0
4K
Member Avatar for -acir-

[ICODE] here's my code below and i cant seem to find out how to return to public static void main after selecting yes in the dialog box. this cud be a very damn question however i get confuse about how to resolve this. thanks. by the way, this program is …

Member Avatar for -acir-
0
883
Member Avatar for villalandron

Hello! I am trying to finish this Recursive multiplication program and I am stuck. What I need to do is write a recursive function that accepts two arguments into the parameters x and y. The function should return the value of x times y. I used this program from the …

Member Avatar for jon.kiparsky
0
181
Member Avatar for TheOnlyNemesis

Hey, i am struggling with this program, i have tried everything i can think of but it still says missing return statement on public String processInput(String theInput){ [CODE]package clientserverassignment; import java.net.*; import java.io.*; public class Protocol1 { private static final int WAITING = 0; private static final int SENTTOS = …

Member Avatar for jon.kiparsky
0
212
Member Avatar for sandman89
Member Avatar for kirankumargali

ITU wants you write some classes for their Personnel Record System. To make it simple, consider only 4 classes: Person, Employee, Instructor and Student. The following figure illustrates the relationship between these 4 classes. The Person class is the parent class of the Employee class and the Student class. The …

Member Avatar for javaAddict
-4
535
Member Avatar for Progr4mmer

when ever i try to compile/run my game in eclipse it says this [QUOTE]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at OurGame.Board.checkCollisions(Board.java:78) at OurGame.Board.actionPerformed(Board.java:40) at javax.swing.Timer.fireActionPerformed(Unknown Source) at javax.swing.Timer$DoPostEvent.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at …

Member Avatar for Progr4mmer
0
104
Member Avatar for Neversleepin

Hi, i'm still beginner in java. Here is my simple question: if we have two java programs like: -test1.java which open a file for example. test2.java which move one file to another directory. Suppose these two programs are working well separately. if one day, we want to write just one …

Member Avatar for Neversleepin
0
159
Member Avatar for kellyslater36

Hi Enclosed is my Java assignment which is due **Tuesday**, any help would be greatly appreciated. Program Specification: (1) Rather than having the trainee type in the full title of his Training Module, let him choose from a menu: the choices should be: “Forward Scanning Radar Display Repair”, “IR Beacon …

Member Avatar for kellyslater36
0
168
Member Avatar for sj5536

hi i created text to pdf converter project in java using eclipse. when i run it from eclipse it works properly. in eclipse i used export menu to create executable jar file(runnable jar).when i run project from that jar file it actually run but it wont convert those text file …

Member Avatar for JamesCherrill
0
180
Member Avatar for infinitus

I dont know how to kill this JOptionPane pop out eveytime i do something... it just pops [CODE]Object[] options = {"Option 1", "Option 2"}; Component frame = null; int n = JOptionPane.showOptionDialog(frame, "Chose Game Option \n *Option 1 - Enter Secret Word\n *Option 2 - Random word selection from secret …

Member Avatar for infinitus
0
162

The End.