Am I thinking about this wrong?... is it only if I alter the object its referencing (using mutator methods) rather than the variable holding the reference? I think this might be my issue.. so if I...
Type: Posts; User: Shaybay92
Am I thinking about this wrong?... is it only if I alter the object its referencing (using mutator methods) rather than the variable holding the reference? I think this might be my issue.. so if I...
Im new the the shallow copy/deep copy concept. I need a little help understanding whats actually going on in this implementation:
public class Stack1 {
private Object value;
private Stack1...
I have an if statement and the entry condition requires the checking equality of a character against several other characters. Is it possible to put these several characters into a list to shorten...
I understand that I have to implement the interface to use a data type as a 'comparable'.. however this is not my issue. The issue is that I want my list to contain any type which implements...
Why didn't they use 0 - 9 ASCII for the numbers 0 - 9? Seems unnecessarily confusing to me!
So when you cast '9' to an int, you are actually getting the internal ASCII representation of '9'. From...
So I have written some code which tells whether a certain Integer is within a list of integers. I tried to do this with a comparable type instead of 'integer' type, but I realised that this wouldn't...
I have googled this issue and apparently it is common, but I'm not sure how to fix it in my case... I think it has something to do with mixing Swing and Awt libraries... Anyway, I am trying to create...
I have been advised to not use key bindings by my tutor.. Is there a way to do this without it? Surely the code above should work!! Even when I change it to another key being pressed for example 's'...
I don't know what Key Bindings are, however I think I may just change it to pressing a JButton to start the game instead... Hopefully this will work. :| I've definitely added the listener to the...
I have a game working successfully with arrow keys, so I know my KeyListener class is fine (canvas is an object of the KeyListener class). So I wanted to add a menu to my game, so that it will have a...
So I would like to loop background music for a game I am making, but I don't want to use the applet library. Is there a way I can do this? My file is .wav and about 21MB. I tried using a tutorial...
Nevermind. I ended up writing the method for each subclass, and defining it as being an abstract method in the super class. This way I could refer to the method using an object from the superclass as...
If you want a method to intake an object of a superclass type, but you want it to do things differently depending on what subclass it is, is it possible to take input as the superclass, and then...
Thanks for the tip. When I run the program it prints inputRepeat as nothing.. I just get an output of:
inputRepeat=<
So are you saying when the previous line is printed in console, it takes the...
So I have created a program to tell whether a number is a prime number or not. I basically did this by finding the modulus of the number with all numbers less than it. If the modulus is 0 for any...
So what exactly is the definition of a class then? How do you justify calling HelloWorld a class? I was looking at this link:
What Is a Class? (The Java™ Tutorials > Learning the Java Language >...
I suppose what I meant is that the primary function of the HelloWorld.class file is not to define a class within it, it does use them, but it itself just prints the words out... From what I know a...
I'm using Eclipse as my IDE for Java coding, and noticed that all files are .class, even if they do not define classes within them... From what I know so far, classes are templates for objects, so...