35,618 Topics
![]() | |
Here is a starter program that prints prime factors of a supplied numbers as a string.It's quite buggy as the input 8 yields 1.2.4 when what i wanted is 1.2.2.2 and I don't understand why the return in line 32 (commented) is not executed. [code=java] //program to compute prime factors … | |
I'm struggling with a servlet that's suppose to represent an "online banking service". Once you run the servlet you'll see it's an extremely simple example... You enter an amount in the textfield provided, then click on the apropriate button depeding what action you want to perform e.g. "deposit","withdraw" and "balance". … | |
ok i need to write something like [CODE] if { days > 5 && minutes > 5 } [/CODE] basically i need minutes to be around 5 to 10, and cannot be greater than 10. how do i do write this within the same if statement? | |
THIS IS A PROGRAM THAT WILL OPEN A WINDOW, THEN WHEN YOU CLICK CALCULATE GPA, A JOPTIONPANE THING WILL OPEN AND YOU WILL PUT YOUR GRADE IN, THAT WILL HAPPEN 2 MORE TIMES THEN THE LAST ONE WILL SHOW YOU YOUR GRADE AVERAGE. WHEN I COMPILE THIS PROGRAM, EVERYTHING IS … ![]() | |
i established an array of objects. i want to user to name a chess piece, the name of the chesspiece then will search the object in the array [CODE]package il.co.ChessInterface; import il.co.Pawn.Pawn; import il.co.Bishop.*; import il.co.King.*; import il.co.Queen.*; import il.co.Rook.*; import il.co.Knight.*; import java.io.Console; public class ChessInterface { public static … | |
copy constructors ?? what are they ? | |
import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; public class DerbyTest { private Connection connect = null; private Statement statement = null; private ResultSet resultSet = null; public DerbyTest() throws Exception { try { Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance(); connect = DriverManager.getConnection("jdbc:derby://localhost:`1527/vineet"); statement=connect.createStatement(); resultSet = statement.executeQuery("SELECT * FROM EMPLOYEE"); while (resultSet.next()) { String user … | |
Hi all, hope u guys r fine. i have a question about array.im using double array,but seems cant support bigger size and im planning to change it to arraylist.but the problem is, can i update the data in arraylist? [code] int value[]={9,8,9,7,9,7}; int[][] myTupple = new int[count][value.length]; repetition =1; for(int … | |
[CODE] <%@ page language="java" import="java.sql.*" errorPage="" %> <% Connection conn = null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); conn = DriverManager.getConnection("jdbc:odbc:mydsn","a", "a"); PreparedStatement psInsertRecord=null; String sqlInsertRecord=null; String dt=request.getParameter("datum1"); String Name=request.getParameter("Name"); try { sqlInsertRecord="insert into ATT (Date, Name) values(?,?)"; psInsertRecord=conn.prepareStatement(sqlInsertRecord); psInsertRecord.setString(1,dt); psInsertRecord.setString(2,Name); psInsertRecord.executeUpdate(); } catch(Exception e) { out.println("Unable to connect to the database"); } try{ if(psInsertRecord!=null) … | |
Hi javaAddicts I am a novice java programmer. I am in a learning process in java servlets. How to load a servlet and invoke its method from index.jsp. I want the servlet to execute first and dispatch its value to index.jsp and also i dont want to use redirect from … | |
[B]How do i resolve this error...i know this exception should be thrown only when i am using an older version jre to run my class file which should be compiled with a newer jdk but i have jdk 1.6 update 18 and jre 1.6 update 21 . thanks for any … | |
I am trying to develop a software that can automatically search and download the correct subtitle for my movies. I need to compare the fps rates. How can i find the fps of a movie in java ? | |
Hi all, I'm using netbeans 1.6 ide to develop my project. When I build my project, netbeans create .jar file. but when I run it it also runs but not like When I run it from ide's run button. Some parts of application do not work example a button click … | |
[CODE]class Faltu { public static void main(String aa[]) { int a=4,b; if (a==4) b=5; System.out.println ("b="+b); } }[/CODE] Here it says : "variable b might not have been initialized", but in the following : [CODE] class Faltu { public static void main(String aa[]) { int a=4,b; if (true) b=5; System.out.println … | |
I have the following XML file: [CODE]<graph caption="ECG Data Wave" subcaption="For Person's Name" xAxisName="Time" yAxisMinValue="-0.025" yAxisName="Voltage" decimalPrecision="5" formatNumberScale="0" numberPrefix="" showNames="1" showValues="0" showAlternateHGridColor="1" AlternateHGridColor="ff5904" divLineColor="ff5904" divLineAlpha="20" alternateHGridAlpha="5"> <set name="12:00:00.01" value="0.600000" hoverText = "The difference from last value: 0" ></set> <set name="12:00:00.02" value="0.640000" hoverText = "The difference from last value: 0.04" ></set> … | |
hi guys!:) ....first I'm new friend for u :$:$:$:$ and for first time I wanna to tell u that I wanna some help ....:S ..In the programming java... I have a game and I want to finish it....who can help me ???:S:S:S:S thx alot u r friend touma | |
hi friends, I am a novice java programmer. I am in a learning process in java servlets. But i struck into a Class method which should return a result set([B]result of a join query[/B])as a an arrayList using the existing bean class. I will show my code as some one … | |
DEAR FRIENDS, I M NEW TO JAVA, PLEASE ANSWER MY QUESTIONS: 1. I am trying to use float and double in java? can u tell me how to use it? 2. I am trying to calculate simple interest in java ? please fix my code: public class simple { public … | |
Dear all, I have some table on my database. i had input them via JSP and i view them on JSP too. i use simple MySql queri in it to view the values of the Table. But when i use another query like : [CODE] SELECT tabel_jawab.nis, CASE WHEN (tabel_jawab.jwb1=tabel_kunci.Kjwb1) … | |
Hi all, I am using JAVAMailAPI for sending emails. And I set the Message.setEnvelopeFrom(ReceiveMailId); to receive the failure notice, and my problem is if the mail host and ReceiveMailId domain, it sent the failure notice, but both are different , it did not sent the failure notification email. How can … | |
import javax.swing.JOptionPane; class homework{ public static void main(string[]args) { String ipt,n,h,r,r2,h2,b1,b2; Double iptipt; JOptionPane.showMessageDialog(null,"1… of a Circle\n" + "2.Area of a Trapezoid\n" + "3.Volume of a Sphere\n" + "4.Volume of a Cylinder"); ipt = JOptionPane.showInputDialog(null,"Input your desired choice(1,2,3,4)"); iptipt = Double.parseDouble(ipt); if (iptipt == 1) ------ IF ELSE STATEMENTS WILL … | |
Hi, I am new. I did my my best to read the rules first so please pardon me if i missed any. My qestion is in regards to filling up a matrix diagonally: "Write a method that accepts a square matrix. Assume that the size of the matrix is declared … | |
i have attached the file i got this system which is help desk information using jsp and servlet but i don know weather its working or not i dont know how to run it?i have netbeans installed with tomcat and mysql..any one can tell me is it working or not … | |
Hi All, I have the following code to read in an XML file and to get the basic statistical information. I am having problems trying to get it working. Here is what I have so far: [code=java] import java.util.*; import java.io.File; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import … | |
Here's the problem... I want to create a table about the stack like this: [code] ((A+B)-C) Symbol Postfix Stack ( ( ( (( A A (( + A ((+ B AB ((+ ) AB+ ( - AB+ (- C AB+C (- ) AB+C- [/code] But i don't know how to … | |
Hi everyone I have to write client/server client/client chat program for at least three machines(users) connected together to chat using java My questions are 1. Do i need to have a server installed ina one of the machines. 2. Do i have to run the server side onf the application … | |
Hey guys, I have two questions. I have a multithreaded server that is able to process requests from more than one client at a time. However, my server has a habit of shutting down after a while, despite that I have an infinite while loop to keep it accepting connections. … | |
Hello, I've looked all over for the solution to this problem, but they all present a similar solution to this one and they all don't work. I've created the JFrame in the constructor for the class that this method is contained in. [CODE] public void print() { JPanel panel = … | |
So i have to write a program that designs a basic Home CAD System. The user will be able to build a house, add/remove rooms and items, etc. I have began writing the program and all seems gravy, i decided to use an ArrayList for the list of rooms the … | |
Hi all Im experiencing problems whereby my codes can only read one file instead of all files in my directory. Does anyone know anything regarding this? Below are my codes: [CODE]import java.io.*; import java.util.*; public class extractionn { public static void main( String[] args ) { File dir = new … |
The End.