32,204 Topics
| |
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? … | |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
[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 … | |
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. | |
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 … | |
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 … | |
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. … | |
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 | |
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); … | |
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???? | |
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. … | |
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] | |
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. … | |
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? | |
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) … | |
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 … | |
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 … | |
[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? | |
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 !! | |
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 | |
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 … | |
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 … | |
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() … | |
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 … | |
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 … |
The End.