java java

Java
12 hours ago

Java += operator

Java
Until today I thought that for example: i += j; is just a shortcut for: i = i + j; But what if we try this: int i = 5; long j = 8; Then i = i...
1 year ago

Java Operator: |=

Java
I just came across the following line inside some sourcecode. int sequ |= element.sequence What does the operator |= mean ? I haven't seen that bef...
1 year ago

Java / Generics

Java
I hava implemented a generic arraylist with public Object[] toArray() { return elementData; } to be able to sort it later. When i tr...
1 year ago

Java: ArrayStoreException

Java
I would like fill an external array with the elements of my ArrayQueue via E[] toArray(E[] a) , but somehow it throws ArrayStoreException at the first...
1 year ago

Java - ArrayIndexOutOfBoundsException

Java
I am working on a java program that generates random numbers and then puts them in an array. Then the program is supposed to go through the array, put...
1 year ago

Java: comments /* * * */

Java
Quick question, it there a difference between: /* This is first line of comments This is the second line And this will be the last line */ and: /...
1 year ago

Java InstantiationException

Java
I made a class to implement an interface and was testing it using another class. This is the class that I created. public class MyWeaponI implement...
1 year ago

Java String.toUpperCase()

Java
Just the other day I ran into a strange strange bug. I had a string of characters that I had to build. And as a delimiter the host system I was commun...
1 year ago

Java BinarySearch

Java
Can I get some help please? I have tried many methods to get this to work i got the array sorted and to print but after that my binary search function...
1 year ago

Java Constructors

Java
I am trying to learn how to specify class constructors in Java. I am starting to understand that they specify the types of instance variables of objec...
11 months ago

Java expressions

Java
I am trying to understand this code in Java 7 environment, int T = getIntVal(); while (T--> 0) { // do stuff here } T is not modified within th...
10 months ago

Java: Graphics2D

Java
import java.awt.*; import javax.swing.*; import java.awt.event.*; public class SimpleGui3C implements ActionListener { JFrame frame; public static ...
10 months ago

Java double.MAX_VALUE?

Java
Hello there I'm in my first year of Computing System Development so I am pretty new to Java and getting to grips of the basics! For my first assignm...
8 months ago

Java - Factorial

Java
I am printing the factorial of the first 10 numbers, so it is 0 - 9. The below code works for me. But I am unable to make the loop such that the facto...
8 months ago

Java Annotations

Java
What is the purpose of annotations in Java? I have this fuzzy idea of them as somewhere in between a comment and actual code. Do they affect the progr...
8 months ago

Java Runtime.exec()

Java
I can run this command from the command line without any problem (the validation script executes): c:/Python27/python ../feedvalidator/feedvalidator/...
8 months ago

Java MySQLSyntaxError

SQL
I'm building a program around a MySQL database using JDBC Driver. I'm stuck at this point. loginWindow lW = new loginWindow(); try { PreparedState...
1 year ago

Java Exceptions

Java
I am practicing for my java oracle certification test and found this in one of the oracle sample questions. I am not sure why the answer is A and need...
7 months ago

Java Connectivity

MySQL
I have a scenario, I have a module in eclipse where need to insert a data into my sql. Here the connection is established successfully and code to ins...
6 months ago