35,586 Topics
![]() | |
[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 { … | |
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. */ … | |
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? | |
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 … | |
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 … ![]() | |
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, … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 | |
[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? | |
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 … | |
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 … | |
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! … | |
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.... | |
[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 = … | |
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 … | |
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 … | |
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 … | |
: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 … | |
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: | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … |
The End.