32,204 Topics

Member Avatar for
Member Avatar for JainishP

This is the class I created to make a MinHeap from data that is being inserted into it: [code]public class MinHeap { protected int [] a; protected int lastindx; public MinHeap() { lastindx = 0; // heap starts at a[1] a = new int[1]; } // is the heap empty? …

Member Avatar for georgeh1
0
429
Member Avatar for pateldeep454

My task is: The Captain Crunch decoder ring works by taking each letter in a string and adding 13 to it. For example, ’a’ becomes ’n’ and ’b’ becomes ’o’. The letters “wrap around” at the end, so ’z’ becomes ’m’. Write a method that takes a String and that …

Member Avatar for pateldeep454
0
899
Member Avatar for tariq1081

my assigment tell me to: Write a program to randomly generate a 3-digit number N (it is ok if the number has fewer than 3 digits). Create a number NN which is N placed next to it. Example, if the number N is 263 then NN is 263263. If N …

Member Avatar for armsracer
0
104
Member Avatar for omar isaid

java.io.FilePermission this exception always thrown when I am trying to run my code using tahiti server that i am developing java mobile agent

Member Avatar for omar isaid
0
117
Member Avatar for omar isaid

the following code I want to press done buttone to close JFrame without exit the application ---------------------------------------------------------------------------------- [CODE] package examples.SecretaryAgent; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Display extends JFrame { private JCheckBox _first_Interval; private JCheckBox _second_Interval; private JButton _done_Button; public Display() { setLayout(new FlowLayout()); _first_Interval=new JCheckBox("First Interval"); _second_Interval=new …

Member Avatar for omar isaid
0
874
Member Avatar for imclumsy

Hey guys, I am trying to read a skel file and create a skeleton from it, but I don't understand how to do the joint class. Here is what i have now: this is the main class. [code] public static void main(String[] args) { // Frame frame = new Frame("Simple …

Member Avatar for emilo35
0
162
Member Avatar for wheriz

[QUOTE=verruckt24;844577]To expand what JamesCherill says in one line, The Java Compiler would add a default constructor if you haven't defined it and if you haven't defined a parameterised constructor either. But the moment you declare and define a parameterised constructor (and then don't define a default constructor) Java assumes that …

Member Avatar for JamesCherrill
0
81
Member Avatar for Ron2794

hi all m not even able to run simplest hello program through java........it is giving a list of number of exceptions.i wrote following [QUOTE] public class hello{ public static void main(String args[]){ System.out.println("Hello"); } } [/QUOTE] Even the above is giving following exceptions classnotfound urlclassloader noclassdeffounderror loadclassinternal findclass etc.

Member Avatar for peter_budo
0
68
Member Avatar for anthony5557

Hey guys, I've been trying to set this up for a while now and I'm getting something funny I just can't figure out. I've installed the jdk 6. I've changes the path and classpath. But when I go to the cmd its not finding it anywhere. I've new to java …

Member Avatar for peter_budo
0
75
Member Avatar for purijatin

Iam unable to run programs from command prompt, my environment variables are correct. When i type javac on command prompt ,it gives the correct data ie possible outputs. When i type java it again responds as it should. But if i run a program say: java practice then it gives …

Member Avatar for peter_budo
0
274
Member Avatar for sneaky667

USING JAVA SWING I HAVE A JFRAME WITH TEXT FIELD WHICH I PASS THE USERNAME AS SOON AS I LOGIN. THE ISSUE I HAVE IS WHEN I NAVIGATE TO ANOTHER FRAME AND COME BACK AT A LATER TIME THE FIELD LOSES ITS VALUES I USED THE hide() and SETVISIBILE(TRUE) methods. …

Member Avatar for stultuske
0
36
Member Avatar for fsn812

Who here would prefer Java over PHP, or PHP over JAVA? If you prefer one over the other, for whatever reason or application, why? Specific code comparisons are appreciated

Member Avatar for mama_rock
0
527
Member Avatar for memo1

I need to converted from seconds to hours, minutes and seconds. (without using if) and this is my code [CODE]import java.util.Scanner; public class SecondToHoursAndMin { public static void main (String[]ages) { Scanner in = new Scanner (System.in); int second; System.out.println("Enter the second: "); second = in.nextInt(); int hours,minutes,second1; hours=(second/3600); minutes=(second%60); …

Member Avatar for armsracer
0
104
Member Avatar for kesh1000

hi all i need a bubble sort algorithm in Java and make a class bubble_sort to sort any given array of any user defined type. can any of u give me a basic algoruthm i need to work with????

Member Avatar for chaospie
0
233
Member Avatar for armsracer

I am making a calendar planner applet. When the user clicks on a date it displays a menu of the different activities that can be performed. Then when the user makes their decision for the activity the calendar is displayed again this time with an updated icon for that date. …

0
59
Member Avatar for mehak_soft
Member Avatar for Eman1

To accept 3 number and find max among three number(using && for checking multiple experssion) [COLOR="Red"]Please help me, I am a beginner in this discipline, and I hope I explain the problem[/COLOR]

Member Avatar for Katana24
-1
68
Member Avatar for Katana24

Hi, im trying to use an actionlistener attached to a button to add a component to a frame I have created. The actual button should add to the frame a circle with some text placed in it which I have already created, it works fine so there's no problems there. …

Member Avatar for Katana24
0
112
Member Avatar for Katana24

So i ve managed to create different shapes in my GUI window. But how would i go about deleting a certain shape or line from the window when I press delete on my GUI screen?

Member Avatar for Katana24
0
250
Member Avatar for jk8204

I need to design a class to represent an oven control unit containing: - Three constants (COOK, BOIL, SELF_CLEANING) with values of 1, 2, & 3. - Boolean value 'on' to represent oven is on or off - Int value for cooking temp, actual temp, and cook time (in min) …

Member Avatar for Katana24
0
120
Member Avatar for firebugg

Hi, I am getting an [COLOR="Red"]Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol[/COLOR] error message when I try to run this merge/sort program. I can't figure out how to fix the program to get rid of the error. Please help. [CODE] import java.util.Random; public class ArrayUtil …

Member Avatar for firebugg
0
2K
Member Avatar for Privoxy

So doing my first year of software engineering at Uni and am having a little trouble with the old Java, Basically I need to use the Calendar class to call todays date, and then store it in a variable, Iv stumbled upon this bit of code but don’t really understand …

Member Avatar for ~s.o.s~
0
108
Member Avatar for solomon_13000

[CODE]public class Testing { static void calculate(Integer... i) {} public static void main(String[] args) { calculate(12); } }[/CODE] What does the ... in the calculate method argument indicates?

Member Avatar for AndreiDMS
0
75
Member Avatar for shivnath

Hello everyone. I want any text string to be rendered as an image using java coding and saving that image as an image file. Plz help me if anyone have any idea. Thanks in Advance !!

Member Avatar for peter_budo
0
66
Member Avatar for danielagaba

hi i wanted to inquire about two things. First, is it possible to connect two phones that both possess wireless cards to each other without there necessarily an access point, if so how could i, in theory, use it to design a messaging application in J2ME. thanks

Member Avatar for peter_budo
0
92
Member Avatar for coderGh

My code is giving me problems can't add items to may stack Array Here is the code i have written public class MyStringArrayStack implements InterfaceStringCollection { public String[] stackArray = new String[0]; public int top; public int newSize; public boolean setMaxSize(int newSize) { if(newSize <= 0){ return false;} else{ top …

Member Avatar for coderGh
0
78
Member Avatar for rue64ja

Hello, I'm trying to write a method that resets a string to a default value (previously defined in a class) if the value inputted is not a valid. Because I know the format or structure of a valid input, I should easily be able to do this. The string is …

Member Avatar for javaAddict
0
73
Member Avatar for musikluver4

The code below is the file for the constructor method and the get methods [code] //Date: 3/18/2010 public class Taxpayer { private int socSec; private double yearlyGross; public Taxpayer(int taxPayer, double income) { socSec = taxPayer; yearlyGross = income; } public int getSocSec() { return socSec; } public double getYearlyGross() …

Member Avatar for javaAddict
0
175
Member Avatar for David22

Hi all. I am up to the final stage of my system, and it requires use of the observer/observable pattern, something I haven't a clue about! Basically, I now have a functioning "WatchList" system with which to store specific objects (Locations). Now, these objects have a number of fields relating …

Member Avatar for JamesCherrill
0
129
Member Avatar for saphireina

pls help me with this problem......its for my exam for finals...pls help me.... here are the instructions: Create a Class of the ff: (focus on payroll) 1. EmployeePay (parent) define: attribute: salary(net), gross, rate, no of hours worked, tax=20% constructor: (2) method: setters/getters, reset()-set number of hours work to 0 …

Member Avatar for saphireina
0
132

The End.