32,204 Topics
| |
Hi, I am trying to compare two objects, but it is not working correctly. Please help. [CODE]/** * Compares theObject with <CODE>this</CODE> object for * equivalence. Do not concern yourself with runtime * efficiency. * @param theObject to be compared with this object * @return true if theObject is equivalent … | |
Hello, I'm a student working on my first hands-on assignment. One of the questions is this: Q4: Write a program that converts a user input temperature from degree Celsius to Fahrenheit or Fahrenheit to Celsius using: C = 5 (F -32)/9 or F = 9C/5 + 32 The user must … | |
So I am a bit confused with the following terms already and how they interact. I am new to IM creation and I want to know the best approach on how to go about this. Anybody can explain them to me? I know ejabberd is a kind of open source … | |
Hey guys, Im having a really hard time with this, I've been searching and trying to work at this for hours but cant get anything to work. If you guys could help it would be amazing. Essentially what I need to do is take this code thats been provided to … | |
I wrote a web service to connect to mysql database. But I can't find a way to call it from the j2me midlet to pass parameters to the web service. Please help me with this. | |
Hello Lovely People, Please have a look at my GUI first, before reading the rest (I've attached a picture, see at the end of my post). I'm having two problem with this GUI. 1) I don't want my Start button to be as long as it is. I want it … | |
The rubric says "In a new class, write a static insertion sort method that takes in an array of Comparable objects...In this new class, create a main that tests your code by making an array of TravelGuide objects and passing it into your insertion sort. Also test that your code … | |
okay so I have an array of buttons, and at some point in the program I want to access the index of a button clicked in order to perform some calculations....so there are two options that I can think of...maybe there is a method to pull out the index (2d … | |
Hello, I have two classes, Help and RecylingGui. I have a button on the RecyclingGui called Help, which when clicked should open the text area created in the Help class. I added the ActionListener for this but nothing is happening. Any help would be appreciated. Thanks. The Code: Recycling Class … | |
Found this sniplet of code on various websites to use this way of playing a wav file however im getting this error message. javax.sound.sampled.UnsupportedAudioFileException: could not get audio input stream from input file Update 1 - I know the wav file has to be 8khz, is there a way to … | |
Hi to all, i just want to know where can i get the scjp voucher and the validity as well.since i am living in hyderabad i am a employee. Is it possible to get the voucher from prometric cneters if yes, please do let me know where are these centers … | |
Hello, i have came across a problem when trying to create a hangman game. I want to read a String of letters inputed from keyboard and then i want someone else to guess this word(typical hangman rules). I have used this code. [CODE]InputStreamReader FindWord = new InputStreamReader(System.in); BufferedReader in = … | |
My friend and I are in a Computer Science I class, and we are momentarily working on a project which asks you to import a method from a previously edited source, into another java source file. Here is our code. [CODE]import java.awt.Graphics; import java.awt.Color; import java.awt.Image; import java.awt.Container; import javax.swing.JFrame; … | |
Why does java need interpreter when its programs are compiled?? | |
Hey Guys i want to create keyUp and keyDown Events on JTable to get value at particular cell as i press up key and Down Key ,i tried to do it and succeeded in KeyDown Event which is : [CODE] ProductTable.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent k){ ProductTable_KeyPressed(k); } }); … | |
I need to write a loop to go through a string and retrieve alternate characters from index positions. Then append the characters to another string and then print (eg. "pleasehelp" = "peshl") I have hit a wall and lack any sort of know how to push through... what have I … | |
I got one interview question, what's the advantage of objects in java ? I surfed, surfing regarding these. | |
Hi... my programs compiles and runs fine...but i still get this error..what am i doing wrong in here... its suppose to print polynomials... [CODE]import java.util.*; public class PolyTest { { public static void main(String[] args) { Scanner stdin =new Scanner(System.in); Polynomial polynomial = new Polynomial(); int coefficients; //= { 2, … | |
dear programmers, i need help with one of my java program. the program should ask the user to enter a sentence and the then return the number of repeated characters in a row. as a example if the user enter "myy naame is joshh"the user should return "3 repeated characters" … | |
Hello there...I need some help when I'm trying to pop data (numbers) from an array into another one (push them). I managed perfectly to input data but I'm completly lost when trying to pop from one array and push it into another one, I tried many things but none of … | |
Hi all, (Firstly please note I am a beginner programmer!). I have the following code where I am trying to print the data base entries, then the user press the space bar to add another entry, followed by the data base contents being printed again. Any pointers in the right … | |
I've been messing around trying to figure out why I'm getting this compiler error for a few hours, and I'm just not sorting it out. Any help would be appreciated. Thanks, David Code: [code] package dladoucer_week5; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input … | |
Hello, I've looked all over the web and can't seem to find how to do this, so I'll try here. I'm working in a program in which i need to draw shapes, specifically irregular polygons. I figured the easiest way to do this, and the one that makes the most … | |
I have all figured out I think except exercise 7.20 Extend zuul by adding an Class called item. Each item is created with a description such as rock or stick and a weight. When creating rooms and setting their exits, items for this game should also be created. When player … | |
There is a great deal of information out there on printing arrays in toString() but most suggest using Arrays.toString(arr); This however prints the whole array even the nulls and is formatted a specific way. I'm looking for a way to print the values in an array that are not null … | |
| Hi, I'm writing a program that reverses the words of a text file using the LinkedList structure. Unfortunately, I have received the following error: [CODE]java.util.Scanner[delimiters=\p{javaWhitespace}+][position=30][match valid=false][need input=false][source closed=true][skipped=false][group separator=\,][decimal separator=\.][positive prefix=][negative prefix=\Q-\E][positive suffix=][negative suffix=][NaN string=\Q?\E][infinity string=\Q?\E] [/CODE] And because of that I'm having difficulty proceeding to the next step. If … |
Hi,if I have array of objects {first(name,age),second(name,age)} How can I access first (name) in java Thanks | |
[CODE] 1. int[][] board = new int[][] {{1,0,0},{0,1,0},{1,2,1}} [/CODE] please explain how we have used index here....like row and column....i know about this we have an array, a, with two rows and four columns. [CODE]int[][] a = new int[2][4];[/CODE] // Two rows and four columns. but what about the 1. … | |
Hello, I am having a problum working on a project. how do I initialized a something that I do not want a varaiable to effect. [CODE]import java.lang.*; import java.util.Scanner; public class HW05_03 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int angleInDeg; double angleInRadians = Math.toRadians(angleInDeg); … | |
I am trying to compile my simple java code and receive two errors. Any help will be appreciated. 1. Java1_Week2.java:19: illegal start of expression public Java1_Week2() { 2. Java1_Week2.java:19: ';' expected public Java1_Week2(){ Here is my code: [CODE]import java.text.DecimalFormat; import javax.swing.*; public class Java1_Week2 { public static void main(String[] args) … |
The End.