32,204 Topics

Member Avatar for
Member Avatar for Akilah712

Hi, I am working on a program for one of my courses. The program requires the use of a command line argument. I am using JCreator and as such my code does not work. Is it not possible to run a program with a command line prompt from JCreator? Thanks

Member Avatar for masijade
0
1K
Member Avatar for vinay1424

[B]I m doing some problems regarding Return type in java.I m facing some problem . could any help plz.[/B] 1. class Plant { 2. String getName() { return "plant"; } 3. Plant getType() { return this; } [B]// what mean 'return this' here [/B] 4. } 5. class Flower extends …

Member Avatar for Darryl.Burke
0
265
Member Avatar for nitol

how to solve this easy problem????? Write a Java program that would input ten numbers form the user and print the ten numbers sorted in descending order.

Member Avatar for jon.kiparsky
0
84
Member Avatar for dbanks4271

public class HealthProfile { private String healthfirstName; private String healthlastName; private String gender; private Float birthday; private Float weight; private Float height; private Double maximumheartrate; private Double targetheartrate; private Double bmi; //starter public void setHealthfirstname( String name ) { healthfirstName = firstname; } public String getHealthfirstname() { return healthfirstName; } …

Member Avatar for coil
0
217
Member Avatar for jssutton11

Hi, I wrote a code to solve the knapsack 0-1 problem by dynamic programming. At a certain point, around 30 max capacity, the code stops adding new values based on the incrementing max capacity and item values. I have no idea why, it finds the correct solution until the max …

Member Avatar for jssutton11
0
378
Member Avatar for Konstar

Last year there was this one kid in another programming class, but all the time he would brag about how he "broke" java. I glanced over his code and it was a mess. But it seemed to be correct. Even our instructor traced it and found no errors. However, whenever …

Member Avatar for Stefano Mtangoo
0
62
Member Avatar for gingerfish

Hello I have a code here. it generates random 2d array [B]kMean[2][3][/B] and then this program calculates the distance between random generated [B]kMean[2][3][/B]s and [B]data[][][/B]. but the problem is, when the random kMean is 1, then it calculates the distance, but when the number or kMean becomes more than one, …

Member Avatar for gingerfish
0
131
Member Avatar for jwmollman

Hello guys, I'm really stumped on this assignment. What I need to do is make a triangle's height based on the number entered by the user. So if the user enteres 4, the output would be this: $ $$ $$$ $$$$ And I can't figure out how to do that. …

Member Avatar for tong1
0
242
Member Avatar for blknmld69

Good Morning, Having all kinds of problems with my programs. Seems as though is trying to read the StudentList file but cant. Im confused. I run the program and it goes to the StudentList.java and gives the errors below after the code. PLEASE HELP! project is past due and the …

Member Avatar for blknmld69
0
402
Member Avatar for Wootens

Hey guys, I recently wrote this program and it compiles and works but I have two issues that need addressing and I'm a bit confused on how to solve them. Question 1) [CODE]System.out.println("What's your name?"); name = Scan.nextLine(); System.out.println("How old are you?"); age = Scan.nextInt(); [/CODE] I always thought Scan.next …

Member Avatar for Wootens
0
241
Member Avatar for alleybye

I need to do a program that the user will input a letter from alphabet then the program will show the alphabet that starts with the inputted letter. for example Letter: B B C D E F G and so on.. please help me guys.. ive been doing this almost …

Member Avatar for bops
0
562
Member Avatar for kandyhyatt

[CODE] 1. /* 2. * Program: Chapter 3 Lab 1 - Programming Project 8 on page 164 3. * 4. * This program caculates the solution to the cryptarithmetic 5. * puzzle TOO + TOO + TOO + TOO = GOOD where each letter represents 6. * a single digit …

Member Avatar for brandonrunyon
-2
119
Member Avatar for cirvelasares

please help me, in applet.. how to make a square..? and how can i move it..like a rectangle movement..?

Member Avatar for coil
0
59
Member Avatar for FNHA

I'm writing a deque implementation with ArrayList as required by my instructor. So far the body of the class looks like this [code=java] try { while (!endOfFile) { character = inputFile.readChar(); while (!character.equals('\u0003')) { if (character.equals('\u0008')) deck.removeBack(); else deck.addToBack(character); } } while (!deck.isEmpty()) { character = deck.removeFront(); if (character.equals('\u0003')) System.out.print("\n"); …

Member Avatar for FNHA
0
140
Member Avatar for Loveday

Good day all! Please I need someone to help me out by telling me what or how will I call up an Applet from a separate Java file that has a main method in it...thats to say, I will compile and run the Applet code from the other class with …

Member Avatar for NormR1
0
2K
Member Avatar for jackcfj0129

Write a program that lets the user enter loan amount and loan period in numbers of years and display the monthly and total payments for each interest rate starting from 5% to 8%,with an increment of 1/8. Your program should have at least [b]2 methods[/b],method for calculation and method to …

Member Avatar for tong1
0
1K
Member Avatar for LianaN

Hi! I'm developing a simple file manager. So, I have two components: JTree & JTable. When I open some folder in JTree, then JTable is updated according to the content of that folder. JTable contains 3 columns: file_type, file_name, file_bytes. The code works correctly. Now I need to add some …

Member Avatar for JamesCherrill
0
92
Member Avatar for hulk33597

i am making a project on speech recognition and i want to integrate it with window. i can open the active window by runtime class by voice but can't close that active window by voice .. like how can i invoke alt-f4,back_space and other special key for window without keypess... …

Member Avatar for peter_budo
0
126
Member Avatar for NewOrder

i want the array to run from one place in diagnol to another place in the array. i set the arguments. here they are [CODE] int rowStart=3; int rowEnd=5; int columnStart=3; int columnEnd=5; int columnX=columnEnd-columnStart; int rowY=rowEnd-rowStart; [/CODE] here is the single loop that i prepared: [CODE] if (rowY>0 && …

Member Avatar for NewOrder
0
103
Member Avatar for daudiam

Forward referencing is allowed during declarations when the undeclared variable is used in the LHS of an expression, but not if its in the RHS. Therefore, the following won't work : [CODE]class A { int a=h; int h; }[/CODE] But the following code works : [CODE]class A { int a=this.h; …

Member Avatar for daudiam
0
222
Member Avatar for daudiam

Is it true that during autoboxing, the type.valueOf() method is called (which creates a new object only if another with the same primitive constant is not in the intern list. This applies to cases where interning is allowed. Otherwise, it creates a new object using new() ). Is this right …

Member Avatar for daudiam
0
139
Member Avatar for PDB1982

I can't seem to get my counting loop to stop if m OR n are <=500. The loop stops only when m hits 499 right now, but I need it to cancel if n is 499. I have tried using a break statement, but I'm not sure what else to …

Member Avatar for jon.kiparsky
0
149
Member Avatar for Protoroll

In my tree class the user can set the fall color of whatever tree they choose, but it's not taking the colors I type in when I test it. [CODE]import java.awt.Color; public class Tree { private String treeSpecies; private int treePrice; private Color currentColor; private Color fallColor; private int treeAge; …

Member Avatar for coil
0
128
Member Avatar for flyingcurry

We have an assignment to write a program finding the nth Fibonacci number. On the web, there are some standard mathematical equations for this, but that would just defeat the purpose of this assignment if I use those formulas. I have my current code down here(with some sketchy back up …

Member Avatar for coil
0
1K
Member Avatar for blknmld69

[CODE] import javax.swing.*; // Needed for swing classes import java.awt.event.*; // Needed for the action listener import java.io.*; // Needed for the file and IOException import java.util.Scanner; // Needed for the scanner class import java.util.List; // Needed for the arraylist import java.util.Arrays; // Needed for the arraylict class /** This …

Member Avatar for peter_budo
0
229
Member Avatar for plasticfood

particularly from a txt file. for example if the file reads "name ###-####-#### address" all in one single line. how do i put all three items in three separate variables and print them?

Member Avatar for CrazyDieter
0
131
Member Avatar for menacingsprite

So I'm trying to build this program for class and the teacher didn't really show us how to do it and is leaving it up to us to figure it out. The directions are as follows: The program will input the divers name, the scores of the 5 judges, and …

Member Avatar for CrazyDieter
0
203
Member Avatar for shruti1210

Is the following code snippet show valid inheritance? [code]class A { int v; final String sayHello() { return "Hello"; } } class B extends A { public int sayHello(int a) { return 3 + a; } }[/code]

Member Avatar for JamesCherrill
0
77
Member Avatar for LianaN

Hi! I would like to add ActionListener to buttons stored in JToolBar. However, if I'm using the code bellow, then I could add only MouseListener ("addActionListener" doesn't work). So, is it possible to somehow add ActionListener? Thanks a lot! [CODE] JToolBar toolBarUpdateDocs = new BrowserToolBar(); toolBarUpdateDocs.setFloatable(false); toolBarUpdateDocs.getComponent(i).addActionListener(new java.awt.event.ActionListener() { public …

Member Avatar for LianaN
0
316
Member Avatar for mishra pradeep

The End.