Click here to Skip to main content
15,881,882 members
Everything / Programming Languages / Java

Java

Java

Great Reads

by ridoy
A brief explanation of application development for Android Wear, helpful for every beginner and intermediate android developer.
by raddevus
Steps for building a device you can add to your existing garage door, which implements an atmega328, bluetooth (hc-05) and relay module which will allow you to open your garage door from any paired Android device.
by Arthur V. Ratz
In this article, we will discuss about the advanced Android application development based on the example of creating a responsive Airport schedule simulator application.
by Afzaal Ahmad Zeeshan
This post attempts to describe the general difference between overloading and overriding in Object-oriented programming languages.

Latest Articles

by Oliver Li 2024
Java Code Change Impact Analysis
by Yochai Timmer
A way to avoid JNI's reflection oriented programming. Wrapping Java with C++
by JudyL_MD
Code sample for passing encrypted compressed data between Windows and Android
by Han Bo Sun
This is a more in-depth tutorial on integrating Lucene search and index engine in Java applications.

All Articles

Sort by Updated

Java 

7 Jan 2010 by #realJSOP
Did you try google[^]. I think not.
11 Jan 2010 by #realJSOP
You probably can. If not, switch to a more competent language.
13 Jan 2010 by #realJSOP
Become familiar with the game and then write code to duplicate its behavior. Chances are that you won't be able to get the source to most games, regardless of their current status.
5 Feb 2010 by #realJSOP
That smiley you have in the code certainly won't compile...
15 Feb 2010 by #realJSOP
Quick answer - use a GUID.If you want more info, you have to ask a better question.
15 Feb 2010 by #realJSOP
You could randomly select them and add them to a HashTable.The HashTable collection don't allow duplicate keys, so you could just keep retrieving randomly selected questions until your hash table contains the desired number of questions.(I'm assuming your question object has some sort...
5 Mar 2010 by #realJSOP
Google is your friend. I found this in another forum.'&&' and '||' are what's called "short-circuiting" logical operators.In the case of &&, if the first operand is false, then it doesn't bother evaluating the second operand, because the whole expression is certain to be false.In the...
3 Apr 2010 by #realJSOP
Among 75000 other hits in google ("java interprocess communications"), I found this:http://www.javaworld.com/javaworld/javaqa/2000-03/03-qa-0324-ipc.html[^]
19 Apr 2010 by #realJSOP
Did you by chance google it? That would be the first thing I would do.
19 Apr 2010 by #realJSOP
Are you calling GC.Collect in your web page? If so, comment that out and see if your web page runs more reliably.By the way, you might also want to consider doubling the amount of RAM in the box.
12 May 2010 by #realJSOP
You're going to have to write one routine in Java, and then one routine in .Net. As long as you use the same encryption algorithm with the same vectors and keys, the result should be the same. The same holds true for decryption.
18 May 2010 by #realJSOP
The very first thing you need to do is think of a really cool name. Something along the lines of "ICantGoogleSoHowDoYouExpectMeToBeAbleToReadAMap". No, wait... that's WAY too long. Maybe "ImACluelessRetardAndICantGetUp". Nah, I think that one is too long as well. How about...
19 May 2010 by #realJSOP
If you want to contact an article author about their article, use the forum for that article.
7 Jun 2010 by #realJSOP
Your best bet is to maintain some sort of progress file (I would probably use a XML file).When the job is about to start, put the job identifying info into the file, and when the job is successfully completed, remove the info. If the job fails, you can restart it based on the info in the file.
24 Jun 2010 by #realJSOP
Most non-consumer-grade routers/frewalls handle this, and the resulting logs can usually be configured to be emailed to an appropriate authority. There is absolutely no need to write code to perform this task.
1 Jul 2010 by #realJSOP
Quick Answers is for asking programming questions about code you're hacving a problem with, and is NOT a forum for diuscussion about projects you'd like to build. There's probably an appropriate forum on this site for this kind of thing, but Quick Answers is NOT it.
13 Jul 2010 by #realJSOP
Do you even know what "client-server" means?
3 Aug 2010 by #realJSOP
First, you need to acquire a cloud, and not just any cloud, but a Microsoft-certified cloud. Don't be fooled by clouds you see just floating by, unencumbered by mere mortals. You're looking for a higher tech kind of cloud utilizing the latest in adherant water vapor technology. Personally, i...
3 Aug 2010 by #realJSOP
Resource allocation is best achieved will sitting on a fully Class 7 compliant commode.
24 Sep 2010 by #realJSOP
Just convert the image buffer bytes to string representations of those bytes. There's even an object that does it for you in .Net. No, I don't remember exactly what it's called, but google is amazingly easy to use.
4 Oct 2010 by #realJSOP
If you're talking about yothe email address you used to register for CodeProject, look ain the top/right corner of this page. You'll see your user ID. Hover your mouse over it, and you'll see a pop-up window. Click My Settings.You can change your email address on the resulting...
6 Oct 2010 by #realJSOP
I strongly suspect that if you need help coming up with a "good network project", you probably don't have the skillset necessary to implement it.
7 Oct 2010 by #realJSOP
Given:int a = 1;int b = 2; You can do this:a = a + b;b = a - b;a = a - b; or this: b = a ^ b;a = b ^ a;b = a ^ b; or just use the std:swap method.
19 Oct 2010 by #realJSOP
Google is your friend. Try it, you might even like it.Nobody is going to just give you code, and demanding it this way will just keep people from responding in a positive way.
22 Nov 2010 by #realJSOP
Would it hurt you to try using google for questions like this? Among the more than 43 THOUSAND results returned, this was the first one:Abstract Classes vs Interfaces[^]
27 Nov 2010 by #realJSOP
Googling this phrase - "deploy java servlet" - revelaed 500,000 hits, and the very first one has the title "Introduction to Java Servlets, Developing your first Java Servlet".Seriously dude - this is the internet, any question you might come up with has almost always been asked/answered...
24 Dec 2010 by #realJSOP
Find out who made the drivers for your web cam, and see if there's an SDK available for it, or do a google search for "C# webcam". Here's pone of the results returned:http://www.c-sharpcorner.com/UploadFile/yougerthen/810262008070218AM/8.aspx[^]
12 Jan 2011 by #realJSOP
Google knows all ("java byte array to base64"). Seriously dude, it took me all of 20 seconds to find this using google:try { // Convert a byte array to base64 string byte[] buf = new byte[]{0x12, 0x23}; String s = new sun.misc.BASE64Encoder().encode(buf); // Convert...
16 Jan 2011 by #realJSOP
I googled "java sql server connection refused", and this was the first link:http://www.websina.com/bugzero/errors/sql-server-connection-error.html[^]If that one does help, there are about 77,000 more search results to chose from.
16 Jan 2011 by #realJSOP
I think the only way you could pull this off is if the application in question could be constrained in a window that your own application creates. Since X-Plane is a game, and since most game companies would never even consider running their game in a window that wasn't borderless and full...
19 Jan 2011 by #realJSOP
I've not done a lot of javascript, but that last if/else statement looks suspect.
8 Feb 2011 by #realJSOP
We don't do homework for people. It's not that we feel like we're superior or anything, it's that you won't learn anything if we do the work for you. Make an effort to do the work yourself, and if you have a specific problem, come back and ask a question about that problem.
18 Feb 2011 by #realJSOP
Really? Evaluate the requirements, decide on your supported platform, and choose the appropriate language/framework. Analisys part of learning how to be a programmer.
22 Feb 2011 by #realJSOP
Here's one[^]
9 Mar 2011 by #realJSOP
Is google a little too much for you to handle?Struts[^]Hibernate[^]Really, it requires VERY LITTLE effort to type that into the google search bar.
27 Mar 2011 by #realJSOP
Pick the one that gets the job done, or don't pick one at all. I've never consciously made a decision to use a specific "design pattern". I do what makes sense for the project, and get on with my life. I usually split the interface as much as possible from everything else, and go with it. If...
14 Apr 2011 by #realJSOP
You can look for documentation using google.Over 5.8 million results await your perusal[^]
20 Apr 2011 by #realJSOP
You given us just enough information to not be able to help you. I'm willing to bet that if you google the error that you didn't give us, you'll find an answer that we won't care about.
22 Apr 2011 by #realJSOP
I suppose you could do a tracert and retrieve the IP address from the first reported hop in the list.
29 Apr 2011 by #realJSOP
One program isn't going to bolster your resume. What got me my first programming job was that I not only attended school full time (I also have a certificate, and not a degree), but that I also held down a full-time job. Yeah, your first programming gig is gonna suck as far as compensation goes,...
18 May 2011 by #realJSOP
it's the same as doing this:Color back;if (minaSelec){ back = Color.RED;}else{ back = Color.LIGHT_GRAY;}
20 May 2011 by #realJSOP
Go here:http://en.wikipedia.org/wiki/Integer_(computer_science)[^]What you're talking about is a signed integer (-128 - 127).A char type is actually represented by (can be cast to) an UNsigned integer (0 - 255).
24 May 2011 by #realJSOP
Oranges
29 May 2011 by #realJSOP
http://develop...
4 Jul 2011 by #realJSOP
You mean to replace the apps that are already in use? If you want to "know the existing technology" used in movie theaters, maybe google would be a better resource.
8 Jul 2011 by #realJSOP
This should explain it[^]
15 Jul 2011 by #realJSOP
What I think you're actually describing is URL rewriting[^].
15 Jul 2011 by #realJSOP
str = str.Replace("\"", "\\\"");
18 Jul 2011 by #realJSOP
Try Monster.com[^]. You are an "employer". That should help get you started finding someone to write the code for you.
17 Aug 2011 by #realJSOP
0) Cocktail napkin1) Feasibility discussion2) Planning3) Design4) Development (aka "Magic happens here")5) Testing6) Release7) Abandonment (Microsoft does this a lot)
24 Aug 2011 by #realJSOP
USE GOOGLE!http://en.wikipedia.org/wiki/JAR_(file_format)[^]
29 Aug 2011 by #realJSOP
That's not legal. An implied copyright is attached to everything that's ever published. You need to get permission from the other web site(s) to use their content, and I doubt you'll get that permission. The best you can do is to provide a link to that news story.
30 Aug 2011 by #realJSOP
By definition, a "pet project" is something that you've dedicated yourself to performing/completing sometime in your lifetime, like building a boat to sail around the world, or inventing the better mousetrap. You can't realistically ask someone else to identify such a project for you.
1 Sep 2011 by #realJSOP
Learning how to use google is a good place to start.getting started with android development[^]
2 Dec 2011 by #realJSOP
Look at your like clause. You're essentially selectiing all records from the course table, and there's no way the idteacher column is going to be "like" a dataset. I suspect (bby looking at your example) that you want to show all teachers that teach a particular course, but your query fails to...
5 Dec 2011 by #realJSOP
Just do this:ArrayList section = new ArrayList();section.add("name1");section.add("name2");section.add("name3");...section.add("name10");0) Why are you using a method to do something as simple as adding a student name to the arraylist?1) I don't...
13 Dec 2011 by #realJSOP
Because you've commented out the line that defines a1...
16 Dec 2011 by #realJSOP
An abstract class cannot be instantiated, and that's why new doesn't work.
21 Dec 2011 by #realJSOP
Go here [^]What you have failed to grasp is that part of the assignment is researching and analyzing ON YOUR OWN, to discover the trends, and come up with an appropriate project. That's part of being a developer. More often than not, you aren't part of a large team of people with...
21 Dec 2011 by #realJSOP
Given the state of the industry and the world in general, how about a simple "Goodbye, World" application? Instead of greeting the user with "Hello, world!" when the app starts, wait until they close the app, and show the phrase "Goodbye, world!". This shouldn't take you more than 10 minutes to...
27 Dec 2011 by #realJSOP
You should block URLs at the firewall because software running on the client machine can be compromised.
27 Dec 2011 by #realJSOP
135 MILLION google results for the serach phrase "java IDE"[^]
28 Dec 2011 by #realJSOP
Go here [^]It sounds like homework because 99 times out of 100, a person asking a question like this who doesn't have a grasp of the requirements is usually in school. Feel free to correct me if I'm wrong in this case.
8 Mar 2012 by #realJSOP
Google.
16 Nov 2016 by #realJSOP
You could use a ready-made tool:6 Best Tools to Help You Convert Java to C# Source Code » CODECALL[^] ...or you could be a programmer and do it manually. It really isn't that tough. Most of Java even uses some of the same class names. The only thing you'd have to be concerned with are...
9 Jan 2017 by #realJSOP
The answer is - QA is not the place to have programming discussions. Use the various forums that exist on the site.
24 Jan 2017 by #realJSOP
Json.NET - Newtonsoft[^]
13 Apr 2019 by #realJSOP
What you need is a recursive function. java recursive functions at DuckDuckGo[^]
14 May 2019 by #realJSOP
Assuming sb2 is a StringBuilder object and you want the hex value... sb2.AppendFormat("{0:X2}{1:X2}", b1, b2));
16 Jun 2019 by #realJSOP
Search engines are free to use: "program type already present" at DuckDuckGo[^]
11 Aug 2019 by #realJSOP
It’s because you’re re-instantiating the list each time you call the list method.
18 Oct 2019 by #realJSOP
Mark it as Not an issue in Fortify and move on
15 Aug 2013 by $r!dh@r
Hi All, How we can secure the our web Application by using Jquery or java script.and if we connected to data base through java script. is this Secure or not?
29 Jun 2021 by - srybczyk-
I am interested in making a website that allows users to check if a certain item is in stock or out of stock. I know that it might be JavaScript and CSS tables but I am not sure. I know people who are making python tools but I am interested in...
28 Mar 2014 by . _Puneet Sharma
How to Start new Activity in android (in AsyncTask) on Post execute use if and else statement ?
27 Aug 2014 by .eclipseWarrior
I searched a lot on google on this subject, but just can't come out with right solution.Part of my code with JLabels created:frame = new JFrame(); frame.setTitle("New family tree"); ... JPanel panel = new JPanel(); panel.setBackground(new Color(30, 144,...
16 Jun 2009 by .Shoaib
Speed up object serialization in Java.
5 Dec 2014 by /\jmot
same question.Stop print Screen for all web browser[^]
15 Mar 2015 by /\jmot
There are many site you can learn Anything.instead of asking here you can search Google to find...
16 Jan 2010 by 002comp
Hi All,I am stuck executing the Java applet file using jnlp where Java is not installed. I need the plugin to be embedded so that if Java is not found, it should run automatically.I tried using this:
10 Apr 2013 by 007alok
I want to develop a OMR Sheet Reader in Java for examination Project but don't know where and how to start ' Guys kindly help me
30 Mar 2011 by 01.mandar
this code works properly on my machine but when i copy it to another machine with all its prerequisite it stops at line 5: var lib = ctypes.open("C:\\myapp\\dl1.dll");function initport() {Components.utils.import("resource://gre/modules/ctypes.jsm"); var lib =...
19 Jan 2014 by 09hadi
I just downloaded Eclipse Keplar, followed by the Android SDK and the ADT. When going to make an android project it shows a cross against package name and theme. Also the next button is disabled. What to do?
31 Jul 2012 by 0belix
Although your aproach will work, i believe the best one is to create a table to hold the primary key of a content, a second table to hold the different languages, and then a third table to hold the translations for the 1st table:ContentTable- ContentId (PK)- CreatedOnLanguageTable-...
10 Jul 2011 by 0Question-Mark0
Hi,i'm wondering if it's posible to stream an internet Radio-Stream with Java?I searched the inet and found a code for playing mp3 files on your pc.The plugin is called JavaZoom.import javax.sound.sampled.*;import java.io.*;public class Radio { public static void...
29 Dec 2021 by 0x01AA
I would suggest to change your SQL to INSERT INTO visitorslog (VisitorName, HostName, DateVisit, VisitType, TimeIn, TimeOut) SELECT VisitorName, HostName, DateVisit, VisitType, TimeIn, TimeOut FROM pvmsvisitor WHERE LogID = 1" Like Richard...
10 Apr 2022 by 0x01AA
I have no idea about Java... See the comments in the code marked with 'HERE X.)
19 Apr 2022 by 0x01AA
You can get some input here, it shows at least the logic, but not the final solution ;) Max Points On The Straight�Line[^] [Edit] A point not to be underestimated, which is not explained there, is to output the points sorted from start to...
27 Jun 2022 by 0x01AA
The pragmatic approach ... ... as soon this works one can think about to optimize it (e.g. loops instead of creating 10 Seconds of the same shape, stereo, etc.). You like to play a sinus- sound: Duration : [Sec] SampleFrequency : [Sample...
1 Jul 2022 by 0x01AA
***Warning*** This is my first java application after a crash course today. Take care, it is a.) inefficient b.) no naming conventions c.) simply fast and dirty But it shows the at least the steps how to build a sine sound. I have also cross...
6 Nov 2022 by 0x01AA
Start working on it and come back asking a question in case you have a specific question/problem. We will not do the work for you!
22 Dec 2022 by 0x01AA
See also my comments to the question. Looks like you missed a small detail in your task description. There, the difference is defined as |arr[i]-arr[j]| But you are calculating the difference simply as arr[j] - arr[i] Conclution Use...
19 Dec 2009 by 0x3c0
This isn't a homework site. If you want source code, then use Rentacoder. If you've already got the foundations of the mailing system, then you need to ask specific questions related to any problems you have.
20 Jan 2010 by 0x3c0
Your algorithm is going to be extremely slow. I would look into using Euler's Sieve (Wikipedia has listed it in the Sieve of Eratosthenes.)To keep the sum of a prime number in your code, just have a variable outside the loops and add i to it every time i == j. For a mathematical solution,...
23 Jan 2010 by 0x3c0
It just generates a random number between 0.0 and the multiplier, in this case 1000 or 256.
21 Dec 2012 by 100,001
I want to write product objects per consumer to a file based on region. This is the method:protected static void writeRecordsToFiles(ProductConsumer[] consumers) { try { BufferedWriter[] bufferedWriters = { new BufferedWriter(new...
5 Dec 2019 by 10xlearner
A post on how to format CPP, C, JavaScript and other stuff
13 Apr 2013 by 1100Neo
I am developing an application in java from the rotten tomatoes api which uses json format. All I need to know is how can I write to a JSON url and read from a JSON url. Thanks in advance.
13 Apr 2013 by 1100Neo
I searched and found this, but it seems very difficult to understand , as I am new to JAVA.http://argo.sourceforge.net/documentation.html[^]
12 May 2021 by 15160877
I want to send an empty hashmap from java to C. After that, I need to store data from C to hashmap and again pass it to java. I can now access my java functions from C. But, now I want to pass a hashmap from java and store the data and pass the...