32,199 Topics

Member Avatar for
Member Avatar for ajayb

public static boolean compare(int[] a,int n) { for(int i=0;i<n;i++) { for(int j=i+1;j<n;j++) { if((a[i]*a[j])%2==0) return false; else return true; } } } there's an error coming when I try to include this function in my prog. I think the place of return true is causing problem.When I write the return …

Member Avatar for ajayb
0
124
Member Avatar for ankurmawanda

i am having some connectivvity issues i am using postgres 9.0 sql db i have installed a dns localhost using the postgres sql driver also i have the jdbc jar files in the lib dir of the tomcat my code is [CODE] <%@ page language="java" import="java.sql.*" %> <% Class.forName("org.postgresql.Driver"); Connection …

Member Avatar for masijade
0
287
Member Avatar for Kate Teoh

Hi, I have a problem about update table in a database. The situation is I have a table named member which store thousand rows of data records about thousand of member for a system. This member table has a field named MemberExpiryDate which used to store each member expired date. …

Member Avatar for Kate Teoh
0
123
Member Avatar for surrey_sailor

Hi, I am a newbie with js so I hope that someone can help me please. I want to make a table with resizable columns. The code here seems to almost do what I want. [URL="http://bz.var.ru/comp/web/resizable-tables.js"]http://bz.var.ru/comp/web/resizable-tables.js[/URL] I have commented out the two lines below so that the columns that are …

0
33
Member Avatar for curbster

Hi I'm in my first Java class, towards the end and am struggling with some code dealing with arrays. I'm not looking for the answers but am spinning my wheels (as usual) and am stuck on a particular problem. I'll list the problem here and then explain where I am …

Member Avatar for Akill10
0
12K
Member Avatar for ticktock

Hey all I am a month or two in coding in java and currently I am doing a java calculator gui project, my professor requires us to code the gui by hand, and I did so with a panel and gridbaglayout layout manager, anyways since this is a calculator I …

Member Avatar for ticktock
0
666
Member Avatar for jsefraijeen

good day sir's/ma'am , please help on how to search an inputted elements to an array... for example... i added a name "JOSEPH" and Address "ILOCOS" and i got an option search in my code and i don't know how i will gonna it... please help me.. [CODE]import java.util.Scanner; import …

Member Avatar for jsefraijeen
0
132
Member Avatar for jackmaverick1

When I declare a class or an instance of the class, I get the error, error: redefinition of 'class player' then after, I get, error: previous definition of 'class player' by the way, I am using gc++. If you want to see the source, just ask. thanx, JT

Member Avatar for Fbody
0
8K
Member Avatar for hanvyj

I have a bit of a puzzle, My default buttons (for when they are only an image) have this "highlight" listener, when the mouse enters/exits it draws a border to give the user some feedback. Its worked fine untill now, where I have a "close" button that, when clicked, removes …

0
47
Member Avatar for stephy1
Member Avatar for stephy1
0
372
Member Avatar for stephy1

I have 3 threads. 3 are going to do a different tasks , so different run() methods. How to overload run() method?

Member Avatar for stephy1
0
88
Member Avatar for stephy1

I got error :At the constructor MyStackThreads "class , interface or enum expected" [code]import java.util.*; import java.io.*; class MyStackThreads extends Thread { Stack thestack= new Stack(); String expression; String splitexpr[]; MyStackThreads[j] { public void run() { try { DataInputStream dis=new DataInputStream(System.in); expression=dis.readLine(); for(int i=0;i<expression.length();i++) { splitexpr=expression.split(expression); thestack.push(splitexpr[i]); } } catch(IOException …

Member Avatar for stephy1
0
380
Member Avatar for erickvla

Hello guys, anyone knows where can I get the "Spring in Action" book on PDF format? Thanks!

Member Avatar for peter_budo
0
115
Member Avatar for vigneswaranm

I want to configure apache with JBoss.., I download Apache 2.X version it starts properly.,And I configure mod_jk and all steps.but,localhost is not working..,

Member Avatar for peter_budo
0
61
Member Avatar for astrojunk

Hi. I'm working on an address book (JDK) which prompts the user to enter 1 if he wants to add an entry, 2 if he wants to search for a name, or 3 if he wants to quit. I'm done with the 'add entry' and exit parts but I couldn't …

0
71
Member Avatar for jecris

In Dorothy Sayers' novel "Have His Carcass", Lord Peter Wimsey describes a cryptography technique that is simple for encoding and decoding, yet relatively hard to crack. Your job is to implement this technique. Here's how it works, in Sayers' (edited) words: You choose a key-word of six letters or more, …

Member Avatar for masijade
0
92
Member Avatar for jecris

Reversed number is a number written in Arabic numerals but the order of digits is reversed. The first digit becomes last and vice versa. For example, if the number is 1245, then it becomes 5421. Note that all the leading zeros are omitted. That means if the number ends with …

Member Avatar for masijade
0
123
Member Avatar for jecris

A number is "prime" if it has no divisors other than itself and1. For example, 23 is prime and 35 is not prime because 35 = 7 x 5. If the digits of a number are rearranged, then usually its primeness changes - for example, 32 is not prime but …

Member Avatar for masijade
0
110
Member Avatar for jecris

A common problem when processing incoming text is to isolate the words in the text. This is made more difficult by the punctuation; words have commas, "quote marks", (even brackets) next to them, or hyphens in the middle of the word. This punctuation doesn't count as letters when the words …

Member Avatar for masijade
0
141
Member Avatar for jecris

Anyone have code with this?... Write a program to find the chain associated with any given number. Start with the given positive integer. This is the first number in the chain. Sort the digits (of the base 10 number) into ascending order, and also in descending order. Subtract the ascending …

Member Avatar for masijade
0
440
Member Avatar for lisaroy1
Member Avatar for mangopearapples

Hi, I was wondering how I can use this type of list: [url]http://palib-dev.com/manual[/url] On the left, there are expandable lists. How can I use them? Thanks.

Member Avatar for mangopearapples
0
143
Member Avatar for kay19

Well, I first made a topic about JDK commands not inputting, but fixed it now. I usually do my work in class when it comes to textpad - java, but right now, working at home. Here's my problem - I can't get it to compile. It gives me an error …

Member Avatar for kay19
0
507
Member Avatar for Davitch

Okay, I am so close to this one I can taste it. I am trying to get the average mileage between two different tanks of gas in this code. I have most of the code written out, but I know there is something missing, so here we go! [CODE]import java.util.Scanner; …

Member Avatar for adarshcu
0
115
Member Avatar for Transcendent

I'm trying to print the average of this: [CODE]public class Grades { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub int [] work = {20, 90, 100, 50, 80, 70}; for (int workValues : work) System.out.printf(" %d", workValues); System.out.println(" "); getAverage(work); modifyElement(work[0]); …

Member Avatar for Transcendent
0
138
Member Avatar for Oddone

This is basically to request help with my program, as was already evident. I am a student, and an assignment asks me to "Write a method that computes the spherical distance between two points on the surface of the earth, given their latitudes and longitudes." I have written this so …

Member Avatar for Oddone
0
163
Member Avatar for speedy94519

Hello, I have a question about the code below [CODE] // Checks the vertex a if (this.a != ((Triangle)o).a) { return false; } [/CODE] So In a method called Triangle i declared an instance variable like this: [CODE] private java.awt.Point a [/CODE] What I think this code is doing is …

Member Avatar for jon.kiparsky
0
150
Member Avatar for sainzkr

Im running into a problem in my code and cant figure out how I can get it to restart or exit upon completion. public static void main(String[] args) { JOptionPane.showMessageDialog(null, "Welcome to Morgage Calculator", "McBride Financial INC", JOptionPane.PLAIN_MESSAGE); String princible; princible = JOptionPane.showInputDialog(null, "Step 1: Enter Mortgage Amount" ); String …

Member Avatar for jon.kiparsky
0
91
Member Avatar for mjv89

Hi, Sorry for another thread. I'm trying to do matrix multiplication in Java now. Here's my code (that wont work). Please let me know if you spot anything that I should change... [code] class multiply { public static void main(String[] args) { int[][] a = {{1,2,3}, {1,2,3}, {1,2,3}}; int[][] b …

Member Avatar for jon.kiparsky
0
132
Member Avatar for mjv89

Hi, I'm trying to learn more about matrices in Java. I am trying to read in two integer matrices A and B, then print out the calculation for A + B, but I am getting an ArrayIndexOutOfBoundsException on line 21. Any help would be greatly appreciated. [code] class MatrixAdd { …

Member Avatar for mjv89
0
88

The End.