32,199 Topics
| |
Hello, I am working on a program that requires the splitting of a string (the string in question is "BSHDDBDSBSHHSBH") so that it can count the occurrences of each separate letter. The code I currently have is: [CODE] public static void countPercent(Scanner input) { String nucl = input.next(); int[] count … | |
I got a simple priority queue of <node> objects. [CODE] Priority Queue<node> queue = new Priority Queue<node>(n,compare);[/CODE] the node object has a few fields, one of them an int field called LB(lower bound) I've build a compare class so the queue would use my compare to sort itself. The problem … | |
for example, i have a txt file that reads: number of items: 2 number of zombies: 3 .... i want to write a method that increments just the numbers, and leave the "number of items" and "number of zombies" alone. is there any way to do this? i can easily … | |
in Stacks what will be the Postfix of this Infix 1. A +B / K - N * R 2. ( A + B ) / ( K-N ) * R 3. A / ( B + K / ( N - R )) 4. ( A + B ) … | |
I really need some help please, I really can't figure out how to do this. I have to take some commands from system.in and put them in a file. when the command 'print' appears I need to read that file and process it. after that I have to be able … | |
I want to use the tree in java but I found tree Set, Tree map I want to know each of them would be used and if I add element to the root how can I add element to this element. | |
| /*THIS PROGRAM PROMPTS THE USE TO INPUT ROOM NUMBERS AND THE FIRST INPUTTED NUMBER WILL BE "OCCUPIED" , AND IF THE ROOM NUMBER(IN THE FIRST INPUT) IS INPUTTED AGAIN AT THE SECOND INPUT IT WILL SAY THAT IT IS "NOT AVAILABLE" . . */ //Here is my code : [CODE]import … |
Hello everyone there. I have a problem with java exercise so can you help me? I would like you to show me detail and clear about all these exercise. 1. Write a console program to define and initialize a variable of type byte to 1, and then successively multiply it … | |
Hi there I'm writing to a file so that it creates a back log of the data and time i did something. I've got the program so it writes the data that is needed and also the date and time. the problem is if you use the program more then … | |
I currently have a program that takes a URL edits it and then opens IE with the new URL. What I also want is it to log in to that webpage once it is opened, but i cant seem to find a way to interact with the browser so the … | |
Hello, my code is [code]import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class LoadDriver { public static void main(String[] args) { Connection conn = null; try { // The newInstance() call is a work around for some // broken Java implementations Class.forName("com.mysql.jdbc.Driver").newInstance(); } catch (Exception ex) { System.out.println("daaaaaaaaaa"); // handle the … | |
This looks like a repeat of a previous thread, but I still haven't cracked it. I'm doing everything on a single Windows XP pc, so no servers or clever stuff involved. I blew the space on MS Access so I'm attempting to return to plan A of using MySQL. Installed:- … | |
i am a first year student and i dont have a clue whats going on. i keep getting this error:Exception in thread "main" java.lang.NoSuchMethodError: main this is the code i am using but i dont think its releated to this. [CODE]public class reverse { public static void main (String [] … | |
[code]import java.util.*; import java.util.Arrays; public class SongRunner1 { public static void main(String[] args){ String title; String artist; int time; int rating; String String1; Random r = new Random(); Scanner console = new Scanner(System.in); System.out.println("Welcome to your music storing program!"); System.out.println("How many songs will be inputted?"); int number = console.nextInt(); Songs[] … | |
Dear friends ....... I am doing a biometric project , so i need a Finger print recognition algorithm and its code in java....... So i request you to help me............ Anyway thank you May GOD bless you Thanks in advance. | |
Dear friends ....... I am doing a biometric project , so i need a face reconition algorithm and its code in java....... So i request you to help me............ Anyway thank you May GOD bless you Thanks in advance. | |
AUCTION.JAVA package English_Auction; /** * * */ public class Auction { // A unique identifying number. private final int number; // A description of the lot. private String description; // private int startPrice; // private int reserve; // The current highest bid for this lot. private Bid highbid; // private … | |
i m trying to send SMS using a java programe. this is my code, in this getPortIdentifier Instruction is not working [CODE]import javax.comm.*; import java.io.*; import java.awt.TextArea; import java.awt.event.*; import java.util.TooManyListenersException; /** A class that handles the details of a serial connection. Reads from one TextArea and writes to a … | |
Hi Guys, These generics are melting my brain.I'm trying to have a list superclass with an arraylist of type T. I then want to invoke the superclass constructor in the subclasses using the type I want to substitute for T, example Product. I'm getting type hiding warnings and quite a … | |
I'm not including code yet as to the fact I've restarted several times. I think if I can determine how to start I can make some headway. Here are my beginning instructions. High-level specifications Your project manager has assigned you the task of developing a subsystem that tracks the populations … | |
Hi - I'm making a program to calculate PI to n number of decimal places, the calculations are all going fine and now I want to combine values from two arrays into one 2D array for quick reference. I'm a-little confused on how to do this. It should go like … | |
Hey guys, I have a problem, I have to take a text and depending if a boolean - split_words is true or false I have to parse the text on some lines splitting the words or leaving them whole. for example, text is: This is the text I have to … | |
I need to create different strings inside a while loop, the problem is how to name them and not having them overwritten each time for ex: [CODE] while (i<10) { String x=scan.nextLine(); //here is the problem, x gets overwritten each time i++} [/CODE] Thank you in advance. | |
package sha; import java.security.MessageDigest; /** * * @author deepak */ public class Sha { public static void main(String[] args) throws Exception{ MessageDigest sha = MessageDigest.getInstance("SHA-1"); byte [] i1 = args[0].getBytes("UTF8"); sha.update(i1); byte[] hash = sha.digest(); System.out.println ("Result: Success"); // Display plain text and digest System.out.println ("Original plain text was : … | |
[CODE]mport java.net.*; import java.io.*; class Ur { public static void main(String[] arg) throws Exception { URL u = new URL("http://www.whitehouse.gov/"); InputStream ins = u.openStream(); InputStreamReader isr = new InputStreamReader(ins); BufferedReader whiteHouse = new BufferedReader(isr); System.out.println(whiteHouse.readLine()); } }[/CODE] It shows the error.. when i changed the site to [url]www.google[/url] .com \Program … | |
Hi all, I'm working on a project where I will have 4 ArrayLists of different types of items(stock, sales etc.). I have one list done but there is going to be a lot of duplication between the 4 list types. I'm trying to create a List superclass which will accept … | |
Hi guys, This week Ive been wrecking my head trying to write a code to run the following program: This program must test the dice 50 times. Then the results will be recorded and summarised. For each number (1 to 6), the program will print the most times that number … | |
Hello! I have the problem with my program visualization at different computers (but the same OS). Below you may see some code pieces related to creating the user interface. Everything is ok with this code at my computer. But I cannot understand why it produces different layouts at some other … | |
Currently trying to understand why this intersection method doesn't work properly, I think the problem is the if statement line but not sure if the problem solely lies there. I've included the necessary files to make my question clearer. The setIntersection method is part of the ArraySet class. The main … | |
i want to make a calculator in which a user allowed to input two numbers in text fieldand on pressing the particular operation button the operation performed.but how could i restrict user to input only numbers and no strings ?? [CODE] import java.awt.*; import java.awt.event.*; import java.applet.*; public class calsc … |
The End.