35,618 Topics
![]() | |
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 … | |
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; } … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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=+ || … ![]() | |
[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 … | |
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); … | |
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. … | |
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â„¢ … | |
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 … | |
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 … | |
how to validate the date in text field if wrong month or date is entered ex if month>14 or date >31 | |
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 … | |
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 <= … | |
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 … | |
can anybody tell me, how to create table dynamically in the same JSP page. I'm using Jsp servlet and hibernate technologies. | |
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=- || … | |
i am beginner in java field.can anyone suggest me how to start image processing in java... | |
please inform me that What is "strictfp" in JAVA ...???? | |
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 … | |
I would like to learn how to program in Java. Does anyone have any textbook /other resource suggestions? | |
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 … | |
While I know how to set this up perfectly, I was wondering, is it possible to set up my jdbc connection with my access database so that I have to put in a username and password? I would really like to do this with access, if it's possible | |
pls suggest me some methods for noise removal of a document image and also about the removal pf the background components of the document image like rules, margins etc. ![]() | |
Hello, I am having some trouble compiling my code for the inventory program part 2, if someone could take a look and help me out I would really appreciate it. Thanks. I am required to implement an array to store, monitor, and retrieve data for camera inventory. [CODE]// Fig 2.4: … ![]() | |
Alright well I decided I wanted to widen my learning a bit with java and decided I was going to write a program that had to do with networking side of things. It took me a little bit of time to come up with something, so I asked my friend … |
The End.