493 Answered Questions for the topic Java
03/18/19
What technology should I use to create a distributed Accounting Software?
Here are my current options.
1. .Net : Using WPF, Visual C#, SQLServer
2. Java : Using Spring, Hibernate, Enterprise DB, web-based
Can you suggest which one is better?, especially with regards...
more
How to convert AutocadDWG To PDF?
Is there another way to convert AutocadDWG To PDF but to use third party programs? Thanks for any suggestions.
Java
03/18/19
How do I count the number of occurrences of a char in a String?
I have the string a.b.c.d. I want to count the occurrences of '.' in an idiomatic way, preferably a one-liner. (Previously I had expressed this constraint as "without a loop", in case you're...
more
Java
03/18/19
rotating a quaternion on 1 axis?
I have a model rotated by a quaternion. I can only set the rotation, I can't add or subtract from anything. I need to get the value of an axis, and then add an angle to it (maybe a degree or...
more
03/18/19
How can I simplify this set of if statements? (Or, what's making it feel so awkward?)?
My colleague showed me this piece of code, and we both wondered why we couldn't seem to remove duplicated code.
private List parseResponse(Response response) {
if (response.status().code() !=...
more
03/18/19
Why does this if statement, with an assignment and equality check, evaluate to false?
How does a Java *if statement* work when it has an assignment and an equality check `OR`-d together??
public static void test() {
boolean test1 = true;
if (test1 = false || test1 == false) {
...
more
Fastest way of finding the middle value of a triple?
Given is an array of three numeric values and I'd like to know the middle value of the three.
The question is, what is the fastest way of finding the middle of the three?
My approach is this kind...
more
Insert variables into SAS using JAVA (IOM Bridge). Should i use CORBA stubs and JDBC or is there any other alternative?
This is part of my code snippet
WorkspaceConnector connector = null;
WorkspaceFactory workspaceFactory = null;
String variableListString = null;
Properties sasServerProperties = new...
more
03/18/19
It it possible to grab SQL tables from a QuickBooks QBM file. Perhaps there is an SQLite Database in there?
It would simplify data import for our software if I could export the tables to SQL or CSV or other workable format. We often export from QuickBooks and import into our software and it would be...
more
03/18/19
Java method to find the rectangle that is the intersection of two rectangles using only left bottom point, width and height?
I have found the solution but wanted to ensure my logic is the most efficient. I feel that there is a better way. I have the (x,y) coordinate of the bottom left corner, height and width of 2...
more
Downloading Java JDK on Linux via wget is shown license page instead?
When I try to download Java from Oracle I instead end up downloading a page telling me that I need agree to the OTN license terms.
> # Sorry!
>
> In order to download products from...
more
Java
03/16/19
How do I parse command line arguments in Java?
What is a good way of parsing command line arguments in Java?
Java
03/16/19
What is the point of "final class" in Java?
I am reading a book about Java and it says that you can declare the whole class as `final`. I cannot think of anything where I'd use this. I am just new to programming and I am wondering **if...
more
Java
03/16/19
How to convert Milliseconds to "X mins, x seconds" in Java?
I want to record the time using `System.currentTimeMillis()` when a user begins something in my program. When he finishes, I will subtract the current `System.currentTimeMillis()` from the `start`...
more
Java
03/16/19
How to convert comma-separated String to ArrayList?
Is there any built-in method in Java which allows us to convert comma separated String to some container (e.g array, List or Vector)? Or do I need to write custom code for that?
String...
more
Java
03/16/19
checking if a point is inside a specified Rectangle?
ok, so i'm doing an assignment for a Java class and one part of the assignment is to find out if a point is within the dimensions of a rectangle. so I created this code:
public boolean...
more
Java
03/15/19
Check whether a string is not null and not empty?
How can I check whether a string is not null and not empty?
public void doStuff(String str)
{
if (str != null && str != "**here I want to check the 'str' is empty or not**")
{
...
more
Java
03/15/19
Java tree data-structure?
Is there a good available (standard Java) data structure to represent a tree in Java? Specifically I need to represent the following:
- The tree at any node can have an arbitrary number of...
more
Java Javascript
03/15/19
need help with this javascript code
Create an array that stores the names of five dogs.Using a loop, evaluate an array index for even numbers. If the value is even, then output "dog name is a good dog", and if it is an odd number,...
more
03/14/19
How to create a method to return 1 or 0 without using conditions?
I was asked a question in an interview to return 1 if provided 0 and return 0 if provided 1 without using conditions i.e if, ternary etc
Just to give you and idea below code without if's:
public...
more
Java
03/14/19
What is the difference between == and equals() in Java?
I wanted to clarify if I understand this correctly:
- `==` -> is a reference comparison, i.e. both objects point to the same memory location
- `.equals()` -> evaluates to the comparison of...
more
Java
03/14/19
Ignoring new fields on JSON objects using Jackson?
I'm using Jackson JSON library to convert some JSON objects to POJO classes on an android application. The problem is, the JSON objects might change and have new fields added while the application...
more
Java
03/14/19
How to get the last value of an ArrayList?
How can I get the last value of an ArrayList? I don't know the last index of the ArrayList.
Java
03/14/19
Hashset vs Treeset?
I've always loved trees, that nice `O(n*log(n))` and the tidiness of them. However, every software engineer I've ever known has asked me pointedly why I would use a `TreeSet`. From a CS background,...
more
Java
03/14/19
Can an abstract class have a constructor?
Can an abstract class have a constructor? If so, how can it be used and for what purposes?
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.