36,051 Topics

Member Avatar for
Member Avatar for rowley4

I need to write an Array List of Pets. An item list is either a Dog or a Cat. For each pet enter a name and type (C for cat or D for dog). Input should stop when the word STOP is entered for the name. I need to also …

Member Avatar for NormR1
0
2K
Member Avatar for BboyRodimus

Here's the prompt guys: Assignment #4 will be the construction of 2 new classes and a driver program (the class containing a main method). [B]Address class[/B] The Address class describes cpu of a bank. It has following attributes: Attribute name Attribute type Description city String the city of the bank …

Member Avatar for NormR1
0
279
Member Avatar for Megha SR
Member Avatar for Xufyan
0
117
Member Avatar for ahsan1

I have downloaded stanford parser package from web because I want to use it in my java program. I don't know that in which subfolder of jdk 1.5.0_22 should I extract the .rar files of stanford parser. Can any one tell me. I'll be thankful.

Member Avatar for peter_budo
0
65
Member Avatar for Shaaani

i wanna ask another thing i have created an applet which has one main file and 7 other class files now i want to connect it to database the following code is in class file on compiling it gives access control exception... [code]private boolean spellCheck(String spell) { Connection Conn; Statement …

Member Avatar for peter_budo
0
110
Member Avatar for Megha SR

hello. i have done the followinh program to convert a String value to a double value.when i am compiling this program, i get an error as"unclosed character literal in the 18th line.can anyone say what's the problem? import java.io.*; class strin { public static String a(String s); { String j=""; …

Member Avatar for jon.kiparsky
0
125
Member Avatar for NewOrder

i know what an interface is. but i dont understand what the use of connecting the objective reference to the interface method and then use it to implement.. could someone explain to me the code..whats going on/ [CODE] interface TextReceiver { void receiveText( String text ); } class TickerTape implements …

Member Avatar for NewOrder
0
119
Member Avatar for glenak

Ok, I'm really confused here. I know that the only way to transfer objects via input/output streams is if they are serialised. If i wanted to transfer objects of my Person class from my client to server, I would have to implement "serializable" in my Person class. That's all well …

Member Avatar for glenak
0
138
Member Avatar for Shaaani

Here is the code... Problem is that it shows a message retCode is not initialized if i written last line in try block it shows return error i dun understand wat to do now plz friends help me private boolean spellCheck(String spell) { Connection Conn; Statement Stat; ResultSet Rs; String …

Member Avatar for NormR1
0
124
Member Avatar for nssltd

Hey i have made a basic chat application in Java using the code from killer game programming in Java. but the problem with this is its just a big open CHAT ROOM so that anyone can log in and just talk/spam. i was wondering how to make a private chat …

Member Avatar for ravi thakur
0
63
Member Avatar for thilinam

Hello everybody. I'm new to java programming. These days I'm developing a client server application using java. Client side is at most finish now. Server side logic is also designed and implemented successfully. But I'm in a trouble regarding following stuff. The server runs an infinite loop. it always checking …

Member Avatar for JamesCherrill
0
111
Member Avatar for rayden150

I was wondering if i could incorporate swing, into the code to create a GUI?: [CODE]public class ComputerMerchandise { public static void main(String[] args) { java.util.Hashtable<Integer, Product> htProducts = new java.util.Hashtable<Integer, Product>(); for(Product product:Products.GetAllAvailableProduct()) { htProducts.put(product.getProductId(),product); System.out.println(product.toString()); } Hashtable<Integer,Integer> orders = new Hashtable<Integer,Integer>(); java.util.Scanner scanner = new Scanner(System.in); while(true) { …

Member Avatar for tong1
0
191
Member Avatar for BboyRodimus

I'm writing two classes for the main program code. I'm stuck trying to do figure out how to instantiate an object of the class Address: [B]Address class:[/B] [CODE]public class Address { private String city; private String state; public Address() { city = "?"; state = "?"; } public Address(String aCity, …

Member Avatar for sneaker
0
1K
Member Avatar for kesh1000

hi all im writing a website for a life insurance agency as a final year project and i need the system to have a mechanism of an online payment system. i have no idea how to create it. could anyone lead me to a tutorial or something which can help. …

Member Avatar for kesh1000
0
585
Member Avatar for neo_31591

ok so the thing is im trying to save information from a register page into a file [code=java] else if(ae.getSource()==b1) { fname=t1.getText(); lname=t2.getText(); rol=t3.getText(); branch=cb1.getSelectedItem().toString(); username=t5.getText(); password=t6.getText(); username.savedata(); setVisible(false); } [/code] the username file is--- [code=java] package Proj; import java.io.*; public class username { public static void savedata() { try …

Member Avatar for neo_31591
0
100
Member Avatar for abhikr7891

hey , my question is that suppose we have an application runnig . it has a jlabel with some text and now in some function i change the text by using setText()func and continue with some other stuff in the function , now the text that i changed is not …

Member Avatar for abhikr7891
0
212
Member Avatar for Xufyan

i've made the following program that count how many times the input character is appeared in a string. [CODE]import java.io.*; class strngcls{ public static void main (String args[])throws IOException{ String s1,s2; char ch; InputStreamReader ir = new InputStreamReader (System.in); BufferedReader br = new BufferedReader (ir); System.out.println ("Type any Sentence: "); …

Member Avatar for NormR1
0
138
Member Avatar for ausops

okay, I'm trying to create a new instance of SimpleCanvas through the FlagDrawer object. I need the SimpleCanvas to be scalable. I can only use the two instance variables and one constructor given to me. What I'm trying to do now is take the class instance variable (int) size and …

Member Avatar for NormR1
0
82
Member Avatar for KatWoman27

I need help on this two assignments: # 1- Write a client and server, Java Swing application using socket connections that allows the client to specify a filename to the server in a Textfield and the server send the contents of the file back to the client if it exists. …

Member Avatar for NormR1
0
101
Member Avatar for churva_churva

[CODE]import java.util.Scanner; public class StudentList{ public static void main(String [] args){ Scanner console=new Scanner(System.in); String students[]=new String [10]; System.out.println("Enter names of students"); for(int i=0;i<students.length;i++) students[i]=console.nextInt(); System.out.println("Students entered are"); for(int i=0;i<students.length;i++) System.out.println(students[i]); } }[/CODE]

Member Avatar for VernonDozier
-1
130
Member Avatar for spv03

package com.inventory.servlet; pst=con.prepareStatement("insert into onscreen_record (add_name, price, zone, cinema, audi, priority, start_date, end_date, length_min, length_sec, client_detail)values(?,?,?,?,?,?,?,?,?,?,?)"); System.out.println(audi); pst.setString(1,add); pst.setString(2,price); pst.setString(3,"ok"); pst.setString(4,cinema[0]); for (int x=0;x<audi.length;x++){ pst.addBatch(); pst.setString(5,audi[x]); } pst.setString(6,position); pst.setString(7,sdate); pst.setString(8,edate); pst.setString(9,min); pst.setString(10,sec); pst.setString(11, client); pst.executeUpdate();

Member Avatar for ~s.o.s~
0
81
Member Avatar for sprankitoy

Hi everyone! you can call me sprankitoy. I am a software developer. I'm a newbie in this discussion community so I might need your expertise should problems arise in the future. I'll be thrilled to answer questions and topics I can relate of specially regarding Java programming and RCP/RAP platforms. …

0
27
Member Avatar for Xufyan

MY question is, like we do for integer and float, Integer.parseInt(args[0]) Float.parseFloat(args[1]) How do we take character input from command line ?

Member Avatar for HeidiC
0
452
Member Avatar for junichiro90

Last time i was facing a problem to connect or link to database for my java program. Actually i have to implement a reservation system, but then after i have sucessfully connect to database, i found out that i can do everything in database, then the class which i create …

Member Avatar for JamesCherrill
0
103
Member Avatar for bibiki

I have the following code: [CODE]import java.util.*; public class Final{ private double guess = 1; public Final(double x){ root(x); } public double root(double b){ double rez = -1; if(Math.abs(guess*guess - b) < 0.001){ rez = guess; } else{ guess = (2/guess + guess)/2; rez = root(b); } return rez; } …

Member Avatar for JamesCherrill
0
77
Member Avatar for khRiztin:)

I would like to set and display a score that varies on how fast the correct answer was made. For example..a question would be answered for only a minute..and the score would be 20points for answering in the range of 1-10 seconds, 15points for answering in the range of 11-30 …

Member Avatar for khRiztin:)
0
108
Member Avatar for thanhlct

[B][I]Dear all,[/I][/B][B][I]I'm a beginer in GATE (General Artchitecture for Text Engineering).[/I][/B] Now, I had a problem when I embed GATE into java and I run Gate's examples such as StandAloneAnnie.java... It didn't error. But when I run project (StandAloneAnnie.java) then has a message "one or more projects were compiled with …

Member Avatar for thanhlct
0
57
Member Avatar for wtf4096

My offline data processing tool (written in C++) is being wrapped under webservices so that it can be executed remotely. We did that already - meaning we have a webservice that can kick off the data processing. However, for some reason, the very same webservice should not grab the data …

Member Avatar for garryamin
0
145
Member Avatar for tinamary

i know the concept of abstract class in java and this concept is used in interface, i.e all the methods declared in interface are abstract. i want to know how the abtract class is different from the normal class in java Thanks a million

Member Avatar for jon.kiparsky
0
155
Member Avatar for Yaserk88

Hi I'm trying to create a random number generator with float values ranging from -1 to 1 i.e.. [-1,1]. The only problem is I can only find methods that do it from [0,1]. Can anyone help me with this? Here is what I have so far.... [CODE]Random r = new …

Member Avatar for tong1
0
98
Member Avatar for NewOrder

my goal here is to create a new array from the old array according to a Criteria that i set (all numbers above 100 and even).. however the program gives me 2 mistakes, and i dont know why? [CODE] public class Array { public static void main(String[] args){ Manipulate manipulate=new …

Member Avatar for jon.kiparsky
0
93
Member Avatar for twistedphrame

Hi, I'm attempting to generate a new cipher key using a string that was negotiated earlier on. On running the code I get the error: Exception in thread "main" java.lang.IllegalArgumentException: Missing argument at javax.crypto.spec.SecretKeySpec.<init>(DashoA13*..) at shared.Cryptographer.makeCipher(Cryptographer.java:254) at client.Main.main(Main.java:60) Java Result: 1 the code is as follow: [CODE] public void makeCipher(String …

Member Avatar for twistedphrame
0
920
Member Avatar for micial30

can anyone help me to construct the code: i dont know how to make the code of entering the operator ,the function of the operator when it was input and the output of the result . limit of the result is 500, Enter First Number:2 Enter Second Number:6 A=+ || …

Member Avatar for coil
0
163
Member Avatar for BestJewSinceJC

[CODE] Integer i = 5; Integer j = 5; if (i == j) System.out.println("true"); [/CODE] ^ Prints true [CODE] Integer i = new Integer(5); Integer j = new Integer(5); if (i == j) System.out.println("true"); [/CODE] ^ Does not print true. I understand that in the second case, the == is …

Member Avatar for BestJewSinceJC
0
109
Member Avatar for glenak

Hey guys, check this out: [CODE] File test = new File(path + "person.data"); FileOutputStream fos = new FileOutputStream(test); ObjectOutputStream oos = new ObjectOutputStream(fos); Person p = new Person(); Person p2 = new Person(); p.setName("Sub Zero"); p.setGender("Male"); p2.setName("Sonya Blade"); p2.setGender("Female"); ArrayList<Person> people = new ArrayList<Person>(); ArrayList<Person> people2 = new ArrayList<Person>(); people.add(p); …

Member Avatar for glenak
0
19K
Member Avatar for tinh khau

My friend; Please help. The green line below is working with a hardcode ApplicantId, and all I need is to make it work by passing the current ApllicantId column on the same gridrow. I tried for many days now, and something like the red line does not work for me. …

0
26
Member Avatar for neigyl_noval

Hi everyone. I wonder why the following code doesn't draw anything. [code=java] package AssProgLang; import java.awt.*; import javax.swing.*; import java.util.*; public class AssOutput extends JPanel { public AssOutput(Queue translatedQueue) { this.translatedQueue = translatedQueue; outputFrame = new JFrame(); outputFrame.getContentPane().add(this); // outputPanel attributes outputFrame.setLocationRelativeTo(null); outputFrame.setPreferredSize(new Dimension(640, 480)); //this.setPreferredSize(new Dimension(640, 480)); outputFrame.pack(); outputFrame.setTitle("ASS™ …

Member Avatar for JamesCherrill
0
355
Member Avatar for NewOrder

This code should return the same object every time. there is a part that i dont understand in the code. why to use private identifiers and then set/get method? why to hide your code variables/methods? [CODE] public class SingeltonEx { public static void main(String[] args) { Singelton singelton=Singelton.getSingelton("Roni"); System.out.println(singelton.getName());//Roni Singelton …

Member Avatar for JamesCherrill
0
180
Member Avatar for NewOrder

i have a bit a weak understanding of those 2 concepts. could you explain to me what is happening in that part of the code? [CODE] public class Part5{ public static void main(String[] args) { // Object[] zoo=new Object[4]; // zoo[0]=new Cat(); Object[] animals=new Object[4]; animals[0]=new Cat(); animals[1]=new Dog(); animals[2]=new …

Member Avatar for NewOrder
0
118
Member Avatar for thamsg

how to validate the date in text field if wrong month or date is entered ex if month>14 or date >31

Member Avatar for cale.macdonald
0
64
Member Avatar for musikluver4

I want to be able to input two (2) 'grades' exactly like they are in the String array and have it come back printing BOTH showing the grades, again, as well as the grade score corresponding to those grades. For example: input C- (enter) B+ (enter) output does: ONLY the …

Member Avatar for samuel_okos
0
690
Member Avatar for iSax

I am a newbie in Java programming. There're one question requesting us to construct an algorithm to sum up all the odd numbers from 0 to 100. Is this consider an algorithm? • Start • set sum to 0 • set number counter to 1 • while number counter <= …

Member Avatar for JamesCherrill
0
99
Member Avatar for P00dle

Hi Daniweb. I just read the other threads on regex and couldn't find the help I am looking for. The problem is simple. I have a bunch of settings in a .xml file which I read into my program. One of the settings is '*.txt', which is used for regex …

Member Avatar for P00dle
0
135
Member Avatar for amrutan

can anybody tell me, how to create table dynamically in the same JSP page. I'm using Jsp servlet and hibernate technologies.

0
49
Member Avatar for micial30

Can you help me to complete the code for this? The result should be in words. And wether 'A' or 'a' will be ok when you input the operator. this was the given: Enter First Number:8 Enter Second Number:9 M=* || m=* D=/ || d=/ A=+ || a=+ S=- || …

Member Avatar for Xufyan
0
89
Member Avatar for aro_kai
Member Avatar for =OTS=G-Man
0
121
Member Avatar for nirvan v. jain
Member Avatar for fringe

selection menu : 1…Area of a Circle ----(3.14 * (r*2)) 2.Area of a Trapezoid ---- (height * (base1+base2) / 2) 3.Volume of a Sphere ---- (.75 * 3.14 *(radius*2)) 4.Volume of a Cylinder ---- (3.14 * (radius * 2) + height how would i make this using methods and switch …

Member Avatar for tong1
0
123
Member Avatar for Elisa

I would like to learn how to program in Java. Does anyone have any textbook /other resource suggestions?

Member Avatar for yasuodancez
0
365
Member Avatar for glenak

Hi, So, I did create a client and a server, and all of them work pretty well. When I send messages to the server, rather than sending one message at a time, I put the information in a class, say like a Person class - I put set the Person's …

Member Avatar for ~s.o.s~
0
89

The End.