32,204 Topics
| |
[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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
How to fetch duration [length] of an audio file? | |
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 … | |
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 … | |
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 | |
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. | |
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. … | |
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 … | |
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? | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
[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 … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.