35,586 Topics

Member Avatar for
Member Avatar for saadismail85

[CODE]public class Getnumbers { private int num1; private int num2; public int getNum1() { return num1; } public void setNum1(int num1) { this.num1 = num1; } public int getNum2() { return num2; } public void setNum2(int num2) { this.num2 = num2; } } [/CODE] [CODE]import java.util.Scanner; public class Case { …

Member Avatar for saadismail85
0
99
Member Avatar for oldSoftDev

hi I am working on HQL queries and writing an application in Java it is just in development phase so I am using a dummy database. But I am having troubles with displaying result using HQL queries. /** * Displays a report listing all companies that have no departments. */ …

Member Avatar for oldSoftDev
0
178
Member Avatar for P00dle

I need to iterate through a TreeMap. I won't be able to use another collection instead of a TreeMap, I am merely changing some code in someone else's program. Is it at all possible to do this? I'm thinking: [CODE]while (Treemap.hasNext())[/CODE] or something similar. Is this possible in Java?

Member Avatar for P00dle
0
84
Member Avatar for laidback7

Hey, I tweaked my code a bit to fix some obvious problems but I'm still having problems trying to implement a gap sort which is a bubble sort that instead of comparing neighboring elements to sort a list, it compares elements 'i' positions apart. Can anyone please help me? Thanks …

0
71
Member Avatar for abhymax

hello everyone ! .. I am Abhinab Roy. I am new to this Place and I am very glad to be here. I am pursuing a course called Diploma in Multimedia & Animation. I have a exam on 17th Nov. .. and I have a problem in Javascript. We have …

Member Avatar for rajarajan2017
0
52
Member Avatar for Mehwish Shaikh

Im making a chat application where one client will send a message to ALL other clients who are currently online through server. The problem is that I'm unable to make such a loop which can infinitely send n receive messages using server. Secondly can't we just use PrintWriter and BufferedReader, …

Member Avatar for ramjeev
0
114
Member Avatar for Ne00m

I am trying to complete an assignment for an introductory java class and need some help in getting past a "Exception in thread "main" java.lang.NullPointerException at Week5Assignment.PartyStock.main(PartyStock.java:70)" error. I'm sure I've forgotten to initialize something but can't seem to find what it is. Any help that you can provide would …

Member Avatar for javaAddict
0
168
Member Avatar for gunjannigam

I am trying to read from a text file which of size 1 MB, and contains 5000 lines of data. Following is the code of class which I am using to read from the file [CODE] public class PlayFile extends Timer implements ActionListener{ File filename; BufferedReader out; //float frameid,prev_frameid; public …

0
60
Member Avatar for pinykifoi

Develop an application that allows a student to open an account. The account maybe savings account or current account. The student has to submit his or her name,faculty,course,year of study,university,telephone contact and e-mail address. The student can withdraw,deposit and perform balance enquiries with the account. If the student has opened …

Member Avatar for masijade
0
75
Member Avatar for iamsmooth

So I'm using an ArrayList (to create a hash table structure) like so: [CODE]protected ArrayList bucketArray;[/CODE] Later in the constructor, it initializes it as: [CODE]bucketArray = new ArrayList(500);[/CODE] When I use it and try to insert a Node from a linked list in like this: [CODE]bucketArray.add(357, nodeToBeInserted);[/CODE] it gives me …

Member Avatar for masijade
0
93
Member Avatar for pochis40

I need an advice: I have a program made from a person that now it is not available. It is a Java applet; it is perfectly working and I have the sources: 4 Java files of, respectively, 326, 210, 119 and 35 lines (not a big program) and a very …

Member Avatar for javaAddict
0
64
Member Avatar for toluyinka2004

can somebody help me to produce a java midlet that randomly generates arithmetic problems for the user and records the time that it takes to answer ten correctly using single digit numbers and operands +,- or *, when a problem is answered correctly or incorrectly, a new problem is produced

Member Avatar for peter_budo
0
41
Member Avatar for kolibrizas

[CODE]int a = 4, b = 3; String code = "a*b+a+2*b"; int result = unknown_function(code); System.out.println(result);//expecting 22[/CODE]Any ideas how to do that please?

Member Avatar for masijade
0
91
Member Avatar for kjiu

Hello, I have to change this code (c++) on Java, can you help me. [CODE] QAbstractItemModel *MainWindow::modelFromFile(const QString& fileName) { QFile file(fileName); if (!file.open(QFile::ReadOnly)) return new QStringListModel(completer); #ifndef QT_NO_CURSOR QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); #endif QStringList words; while (!file.atEnd()) { QByteArray line = file.readLine(); if (!line.isEmpty()) words << line.trimmed(); } #ifndef QT_NO_CURSOR QApplication::restoreOverrideCursor(); #endif …

Member Avatar for masijade
0
81
Member Avatar for yakovm

Hello We runing rmi client and server from one computer the code files in the same directory [CODE]javac *java rmic FileImpl start rmiregistry java -Djava.security.policy=policy.txt FileServer[/CODE] after that we start a client [CODE]java FileClient kuku.txt 127.0.0.1[/CODE] Does we intiate several JVMs by starting client and server if not how to …

Member Avatar for masijade
0
85
Member Avatar for lithium002

Hello, I've a program that asks a user for four different integer values, and then draws a rectangle on a graph based on those values. I have done everything except now I need to set limits within the program so a user can only use valid values and I'm lost! …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for bruceaj

I'm trying to pass "this" as an argument of a constructor. Is there any way can determine what the type of Object "this" is? Thanks....

Member Avatar for bruceaj
0
65
Member Avatar for wolfy101

[CODE]import java.util.*; class multiplicationquiz { public static void main(String[] args) { Scanner a = new Scanner(System.in); int b,right,totalscore; right = 1337; //boredom totalscore = 0; b = 0; do { double numb = Math.round((Math.pow(10, 2) * Math.random())); double numb1 = Math.round((Math.pow(10, 2) * Math.random())); double valueFirst; double valueSecond; valueFirst = …

Member Avatar for rigidboss
0
95
Member Avatar for ineedhelp09

Hey everyone, I'm new at this.. so please bear with me. Anyway, I'm really confused. I'm supposed to convert the first character of the String firstName to upper case. Problem is... I have no idea how to :-/ I've done so much research and reading and still nothing. Please help …

Member Avatar for webmstr
0
184
Member Avatar for ceatkin2

Here's my problem. I'm reading in a string of numbers from the user using the scanner class in the main method. I assign that to a variable "s". I pass "s" to a method that converts the String (let's say its a string of 10 numbers) and trying to convert …

Member Avatar for oldSoftDev
-1
110
Member Avatar for gibson.nathan

ive got most of this figured out. the problem is then when i run, instead of my methods iterating through my array list, they simply reuse the same data set over and over, giving the same results. if anyone can help, it is appreciated. [CODE] /** * Write a description …

Member Avatar for gunjannigam
0
126
Member Avatar for abhymax

:icon_smile:[B] hello everyone ! .. I am Abhinab Roy. I am new to this Place and I am very glad to be here. I am pursuing a course called Diploma in Multimedia & Animation. :(I have a exam on 17th Nov. .. and I have a problem in Javascript. We …

Member Avatar for abhymax
0
83
Member Avatar for faeze.m

please help me to write a program polynomial codes in java(multiply.add &.....between polynomial)????ok? every one can write this program please help me... thanks alot:icon_smile:

Member Avatar for rcook
0
85
Member Avatar for frankycool

I have an arraylist As such :- products.add( new CarsSubProduct( "FordMustang",1,12,10000 ) ); products.add( new CarsSubProduct( "JEEP",2,10,10000 ) ); I am trying to Edit just the value 12 without altering the value of the other objects but no success.When i use the set method it automatically modifies all the four …

Member Avatar for ~s.o.s~
0
847
Member Avatar for Rahyalain

This my problem>>>>if any one can solve it>>> Write a java program that calculates and prints out bills of the city water company. The water rates vary, depending on whether the bill is for home use, commercial use, or industrial use. A code of 1 means home use, a code …

Member Avatar for VernonDozier
0
2K
Member Avatar for tknopriest

OK... so I am pretty new to Java and need some help. I'll try to explain as best I can... I am trying to create a frame that will be a "menu frame" and then based on which option the user picks (JButton) it will then run the version of …

Member Avatar for tknopriest
0
75
Member Avatar for mkfastian

hello , my problem is that.. i have 2 treeview treeview1 and treeview2 my problem is that when i add the node on treeview1 then i want to just copy the same treeview1 node to another treeview2 node please tell me how to do that i just want to ask …

Member Avatar for mkfastian
0
83
Member Avatar for mkfastian

hello , my problem is that.. i have 2 treeview treeview1 and treeview2 my problem is that when i add the node on treeview1 then i want to just copy the same treeview1 node to another treeview2 node please tell me how to do that i just want to ask …

Member Avatar for mkfastian
0
76
Member Avatar for spiderpratik

How do I run an applet in the BlueJ terminal window? Please provide a code for the solution or an alternate method to do this as soon as possible. [code=Java] package applets; import java.awt.event.*; import java.awt.Graphics; import java.awt.Font; import java.applet.Applet; public class NervousText extends Applet implements Runnable, MouseListener { String …

Member Avatar for spiderpratik
0
97
Member Avatar for Bheeman89

Hello Guys. I need a help here. I am doing a system using Java with GUI. SO im curious how to add a value that i have extracted from a JTextField and display it as a List in the Jlist. Here is my coding [CODE] //function for collecting data from …

Member Avatar for javaAddict
0
521

The End.