32,199 Topics
| |
**EDIT: I understood what was wrong. I initialized adrsarr[4] before trying to put in values, then the problem was solved. Please close this thread.** package personal; public class TestAddress { public void buildArray(Address[] adrsarr) { adrsarr[0] = new Address("B402", "3", "42", "Behind Sector 9", "New Delhi", "Delhi", "Delhi", "India", "232113"); … | |
Help..i need java program with help of bufferedReader and IOException... to find sum of 2 nos. entered by user.. plz help i am new to java... | |
A parking garage charges a S.R. 2.00 minimum fee to park for up to three hours. After that, garage charges an additional S.R. 0.50 per hour for each extra hour or less. The maximum charge for any given 24-hour period is S.R. 10. No car parks for longer than 24 … | |
Hi I am trying to implement an array based BT.Here is my code for this. But I'm stuck with Postorder traversal. How can I get a Postorder traversal from my array based BT ? My Entire code is given here. package com.TreeLab; public class Stack { private final int SIZE … | |
Write a program that prompts the user to enter a filename (use a Scanner to get the filename). The program then ouputs to the screen the number of lines, words, and characters in the file. Here is my code: (I'm getting a infinite while loop): import java.util.Scanner; import java.io.*; public … | |
Write a program that prompts the user to enter a filename (use a Scanner to get the filename). The program then ouputs to the screen the number of lines, words, and characters in the file. Im having trouble counting the words Here is my code: import java.util.Scanner; import java.io.*; public … | |
I am trying to add a try catch block with switches to my program in NetBeans, and it is not excepting any of my already declared variables?? Here is my original code, without any validation: package annual; import java.util.*; import java.lang.*; public class Annual { public static void main(String[] args) … | |
I created a hashing method to make a=1, b=2, c=3...etc. To me it doesn't seem too efficient. Does this look efficient or is there a recursive method or smaller method to do the same thing? /** * Changes String to int * @param key: String * @return (result % arraySize): … | |
Hi I recently started working with Java (this morning to be exact) and I'm running into some trouble. I'm trying to make a simple program that will put a deck of playing cards into an array, shuffle that array, then print the shuffled deck. My eventual goal is to make … | |
i have to do a program in BDK.my BDK and JDK are in the same folder java. i have set the path for jdk/bin in control panel.i have created the jar file, jar cfm [jar file name] [manifest file name] [java class name]. i didn't get any error there. but … | |
Hi all, this is my first post as a user, however ive been using this site to aid me in some of my programming assignments. I have become a little stuck with one program that i am trying to create which is a random number generator for 6 numbers. Ive … | |
I've been learning Java by myself through many different online and offline resources. I just finished some basic practice and theoretical knowledge of Swing. Now, to become good at it I need some practice problems which would test my Swing skills, including GUI Building, listeners etc. But I can't figure … | |
Last week I was working on some assignments using JDBC and now when I try to run programs in Eclipse this is what I get...and this is only part of the message that appears in the Console box instead of what should show when I run a program. What did … | |
Sorry everyone i'm new to java and i have an assingment which i have hand over soon i just want get an idea how to calculate car insurance premium based on the age,Licence and Engine size this is my first time come in to this site even so.. if you … | |
Hello, World! My name is Alex and i am a beginner in Java. I tried to create 2 simple objects from the same class and give them the values inputed from console( as string). Is this correct or it should be done in another particular manner? Also, the constructor asks … | |
| I am trying to build XML to csv conversion The problem is extended attributes ( <AttrList> ) that I do not know how to read: This is the XML: <?xml version="1.0" encoding="UTF-8"?> <ProductCatalog> <Product> <ProductCode>FFC4UINTSATA</ProductCode> <Vendor>INTEL</Vendor> <ProductType>Cable</ProductType> <ProductCategory>Cables</ProductCategory> <ProductDescription>INTEL SAS/SATA internal cable (4xSerial ATA 7-pin (Male) - 1x (Male))</ProductDescription> <Image>https://www.it4profit.com/catalogimg/wic/1/FFC4UINTSATA</Image> … |
Hi, I have one class where JFrame is created and 4 classes (JPanels - Menu, Game, Score, etc.). In the class, where I am creating Frame I also create new Menu (JPanel) .. in menu, I have 4 buttons. If I click e.g. on a button Start ... the new … | |
I am trying to create Menu to may 2D game in Java. But the game is not responding to pressed keyes. Menu is working, but when I choose new game in menu, game starts but it does not react to pressed keyes. But, when I remove menu, game is responding … | |
I am using javaCC to parse through sql statements and put the data in corresponding lists. I have made the grammar for a create table that works well but now I need help on making a insert statement grammar. This is the create table grammar that I have used but … | |
I am trying to style a log in menu that is created by this snippet i have here (generated by javascript): <script> var password; var correctpassword = "DaNiWeB"; password = prompt ('Enter the Correct Password to view this page:',''); if (password==correctpassword) alert('Thank you for properly entering the password, you may … | |
I was wondering if anyone had a good implementation of a List of list. The reason is to create rows and columns sort of like a database or spreadsheet format. I would like to insert data into the list and print it in the format of Column Column Column Column … | |
I am creating a method to multiply 2 polynomial expressions together such that: `3x^5 * 2x^3 = 6x^8` -> Where the coefficients are multiplied and the exponents are added together. My test case for this would look something like the following @Test public void times01() throws TError { assertEquals(Term.Zero, Term.Zero.times(Term.Zero)); … | |
Hey can you guys help with this? Basically with all that is left? Thank you! import javax.swing.*; //for JFrame import java.awt.*; //for Graphics and Container import java.util.Random; import javax.swing.JOptionPane; // other import statements here public class RandomGraphics { // constants are used to draw the grid, and for you to … | |
My applet creates a new sound every time an impact occurs, which is very frequently. How come, when the sounds become too numerous, the game ceases to run smoothly? Here is the code that gets called many, many times: class soundThread extends Thread { String sound; soundThread(String i_sound) { sound … | |
I have to mirror a piece of the picture right to left. Here is what I have: My picture stays the same everytime I run the code. I even switch my for loops to see if it would make a difference but it doesn't. My picture just stays the same. … | |
Hi, This code doesn't seem to compile. I can't seem to figure out what's wrong with it. The error I get is: **cannot find symbol - method contains (java.lang.string)** public void getName (String name) { for (olympian filename: Olympians) { if (filename.contains(name)) { System.out.println(filename); } else { System.out.println("Nothing found"); } … | |
Still playing with multi-threading and Prod-Con, at this point I've been at this for days. Would love some help debugging; thanks in advance. http://pastebin.com/jhHB9kTY - Main http://pastebin.com/BZSspf3x - Consumer http://pastebin.com/ndzAADJz - Producer http://pastebin.com/p7YdzH1D - Product http://pastebin.com/rxs3WzDT - Message http://pastebin.com/JR5ywgz1 - Utiliy 2 Producers, 4 Consumers Essentially Producers push a message … | |
I am writing code in java to support a working database. What I mean by that is I will have linked list store the data(I plan to change later) and use a parser to break down sql statements in turn interacting with the linked list. The question I have is … | |
Hi, Why does this piece of code throw me an error saying: **cannot return a value from method whose result type is void**? public void orderTotal() { int total; for (Order filename: Orders) { total = filename.getQuantity(); } return total; } | |
Hi folks. I am in search of automated swing builders (stylish jframe builders). Basically like IDE's. Yeah I am well familiar and bored of this netbeans, eclispse, etc. Can anyone suggest me some tools that will create some cool and **stylish** jframes or swings by just drag and drop.. I … |
The End.