32,199 Topics

Member Avatar for
Member Avatar for Rogue Hermit

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 …

Member Avatar for joehms22
0
102
Member Avatar for arthurr.ie

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 …

Member Avatar for jon.kiparsky
-1
143
Member Avatar for plasticfood

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 …

Member Avatar for plasticfood
0
109
Member Avatar for amras123

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 ) …

Member Avatar for peter_budo
0
60
Member Avatar for Alex86fire

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 …

0
70
Member Avatar for eman 22

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.

Member Avatar for masijade
0
91
Member Avatar for Codeslinger

/*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 …

Member Avatar for apines
0
107
Member Avatar for socheata

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 …

Member Avatar for apines
0
153
Member Avatar for ajst

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 …

Member Avatar for ajst
0
185
Member Avatar for ajst

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 …

Member Avatar for ajst
0
139
Member Avatar for taufiqbzz

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 …

Member Avatar for masijade
0
130
Member Avatar for StevePrim

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:- …

Member Avatar for masijade
0
293
Member Avatar for ronan269

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 [] …

Member Avatar for Abdel_eid
0
306
Member Avatar for RetNaRome

[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[] …

Member Avatar for javaAddict
0
486
Member Avatar for sijothomas

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.

Member Avatar for masijade
-1
56
Member Avatar for sijothomas

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.

Member Avatar for masijade
0
71
Member Avatar for dee2020

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 …

Member Avatar for dee2020
0
127
Member Avatar for Nidhi S.

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 …

0
61
Member Avatar for comSysStudent

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 …

0
68
Member Avatar for atticusMom

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 …

Member Avatar for quuba
0
338
Member Avatar for Katana24

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 …

Member Avatar for Katana24
0
2K
Member Avatar for Alex86fire

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 …

Member Avatar for Alex86fire
0
161
Member Avatar for mar1obaz

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.

Member Avatar for mar1obaz
0
103
Member Avatar for Deepak20

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 : …

Member Avatar for Deepak20
0
203
Member Avatar for natha_peepli

[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 …

Member Avatar for natha_peepli
0
172
Member Avatar for comSysStudent

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 …

0
67
Member Avatar for Oregand

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 …

Member Avatar for kramerd
0
119
Member Avatar for LianaN

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 …

Member Avatar for LianaN
0
163
Member Avatar for kezkez

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 …

Member Avatar for kezkez
0
178
Member Avatar for Xufyan

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 …

Member Avatar for ajst
0
1K

The End.