|
Adding on to Internet Janitor and MEAT TREAT's ideas: * What autoboxing is * A pretty comprehensive understanding of the Collections framework (difference between Set, List, Map and their implementations), Iterator, etc. * Difference between long, int, double, float * What the heap and stack are * Difference between an Error and an Exception * If you really wanna bake them, ask about bytecode (what's the difference between invokestatic and invokevirtual, for instance) or JVM internals
|
# ? Jul 28, 2012 18:51 |
|
|
# ? May 9, 2024 22:31 |
|
That all makes me feel pretty good. I don't feel like a Java expert at all (I only taught myself last year for Android development), but I feel like I have an ok understanding of at least half of the things mentioned in the previous few posts. Yay me. I don't work in anything programming related, but out of curiosity, how much could someone make as a Java dev who understands as much as me?
|
# ? Jul 29, 2012 01:39 |
|
I'm making a TCP based p2p program in java for a class. To read/write, i'm using InputObjectStream and OutputObjectStream. Is there a way to send/receive multiple types of objects through the socket?
|
# ? Jul 29, 2012 02:08 |
|
Did not know about weak references. Or soft or phantom references. Weak references sound extremely useful if you're doing a lot of work with Collections. I don't understand how a senior developer wouldn't be using them, or why I'm just hearing about them now. Thanks!
Safe and Secure! fucked around with this message at 02:25 on Jul 29, 2012 |
# ? Jul 29, 2012 02:10 |
|
Safe and Secure! posted:Let's say that I claimed in an interview that I was a Java wizard, and this set my interviewer off on a mission to ask me increasingly difficult questions about Java to if I was lying. What kinds of questions/topics would I be asked about? If I really wanted to stump someone, I would ask them to implement a singleton that is constructed when it is first requested, that has public static members, and does not synchronize on getInstace(). (hint: it's impossible) But that's only if I was being an rear end in a top hat. In general I don't care if someone knows the minutiae of Java, cause it doesn't mean they can write code worth a crap. Thermopyle posted:That all makes me feel pretty good. I don't feel like a Java expert at all (I only taught myself last year for Android development), but I feel like I have an ok understanding of at least half of the things mentioned in the previous few posts. Yay me. Understanding poo poo like that is worth roughly $0. Understanding all that stuff and knowing how to properly structure programs, lead product development, and in general get poo poo done would net you a lot of money as a senior lead.
|
# ? Jul 29, 2012 03:06 |
|
Ranma posted:If I really wanted to stump someone, I would ask them to implement a singleton that is constructed when it is first requested, that has public static members, and does not synchronize on getInstace(). (hint: it's impossible) Nope, it's definitely possible. Java code:
|
# ? Jul 29, 2012 03:27 |
|
Safe and Secure! posted:Let's say that I claimed in an interview that I was a Java wizard, and this set my interviewer off on a mission to ask me increasingly difficult questions about Java to if I was lying. What kinds of questions/topics would I be asked about? If you say Java wizard then I will ask you general OCJP certification level stuff like how do you multi thread in java, what is the volatile keyword for, what type of collection would you use if you want to store sorted objects allowing duplicates, what is an anonymous class, how does garbage collection work in java and something like name me a java framework you worked with and what did you do with it. Of course before that we use a very dumb question to filter most people; explain pass by value and pass by reference concepts applied to java.
|
# ? Jul 29, 2012 03:48 |
|
Ranma posted:Understanding poo poo like that is worth roughly $0. Understanding all that stuff and knowing how to properly structure programs, lead product development, and in general get poo poo done would net you a lot of money as a senior lead. I think he wasn't talking about the value of the skill itself, but rather how much someone with his level of experience might be able to market his skills for. Thermopyle posted:I don't work in anything programming related, but out of curiosity, how much could someone make as a Java dev who understands as much as me? Probably a question for another thread, but location makes a difference, and I have no clue how experienced a developer you are. Upwards of $60k for sure, possibly $70k or $80k+. And I'm lowballing for the Bay Area (but then, higher Bay Area rent will easily make the difference).
|
# ? Jul 29, 2012 03:58 |
|
Jabor posted:Nope, it's definitely possible. The IBM article is under Java 4 and using a slightly different form.
|
# ? Jul 29, 2012 04:03 |
|
Doctor w-rw-rw- posted:I think he wasn't talking about the value of the skill itself, but rather how much someone with his level of experience might be able to market his skills for. In Chicago there's a ton of high profile Java firms and talent is thin, you could get near 100k here if you didn't suck and hung around for 4-5 years.
|
# ? Jul 30, 2012 01:41 |
|
Jabor posted:Nope, it's definitely possible. awesome! learned something new
|
# ? Jul 30, 2012 03:17 |
|
Jabor posted:Nope, it's definitely possible. If you have other static methods in your singleton, you're doing something wrong (really, they don't belong there, move them someplace else). Since the only static method should be getInstance(), there's no need for a LazyHolder. But, technically, there's nothing wrong with your code.
|
# ? Jul 30, 2012 05:14 |
|
Aleksei Vasiliev posted:Also you can do double-checked locking in Java 5, it's in Effective Java 2E. Pretty sure he knows what he's talking about. Since you didn't mention it, Bloch says that the best way to do a Singleton is by extending Enum. Java code:
|
# ? Jul 30, 2012 05:49 |
|
MEAT TREAT posted:Since you didn't mention it, Bloch says that the best way to do a Singleton is by extending Enum. Java code:
Sedro fucked around with this message at 06:08 on Jul 30, 2012 |
# ? Jul 30, 2012 06:06 |
|
trex eaterofcadrs posted:In Chicago there's a ton of high profile Java firms and talent is thin, you could get near 100k here if you didn't suck and hung around for 4-5 years. I was lowballing. It's more like 2-3 years if you're good than 4-5 years, in the Bay Area. I know people who make less and work in areas where cost of living is also much lower, so they enjoy a similar discretionary income level. But this isn't a programmer salary thread, this is a Java thread. Moving on... --- Is anyone sad that Java 7+ improvements may never make it into Android, since the language is no longer especially "open"? Is Apache Harmony dead because of a legal reason, or just developer lack of motivation, because there's no open-source technology compatibility kit? Could an open-source suite of unit tests help (eventually, when it's comprehensive enough to be a credible test for completeness)? Doctor w-rw-rw- fucked around with this message at 09:19 on Jul 30, 2012 |
# ? Jul 30, 2012 09:10 |
|
I was excited for Java 7 until I found that we still wouldn't be getting real closures.
|
# ? Jul 30, 2012 11:55 |
|
Ranma posted:Understanding poo poo like that is worth roughly $0. Understanding all that stuff and knowing how to properly structure programs, lead product development, and in general get poo poo done would net you a lot of money as a senior lead. Doctor w-rw-rw- posted:I think he wasn't talking about the value of the skill itself, but rather how much someone with his level of experience might be able to market his skills for. Yep. Being self-taught, working in seclusion, and not being in the industry makes it hard to know what you're worth. Thanks for the info...
|
# ? Jul 30, 2012 18:46 |
|
Thermopyle posted:I don't work in anything programming related, but out of curiosity, how much could someone make as a Java dev who understands as much as me? 50-60k in Atlanta. 85-110k after 5 years.
|
# ? Jul 30, 2012 18:54 |
|
lamentable dustman posted:50-60k in Atlanta. 85-110k after 5 years. Welp, looks like salaries for Java programmers is sufficiently on-topic that others are still talking about it. If you play your cards right, being new to the industry in the Bay Area, you can probably start at $80-90k as a junior software engineer, depending on how well you negotiate, how well you interview, who you work for, and possibly other circumstances. If you prove yourself, jump jobs with good timing, and gain the right kind of experience, you can be making $10-20k more than that in a year or two (aka: lucky as poo poo), then you'll want to stick around somewhere for a while and follow a track to go from software engineer to a normal software engineer, then become a senior software engineer. On the other hand, you might also consider a different track, which is to build some recurring income from stuff you build and put out there, which will then give you the flexibility to choose a job that will teach you the most, which you can also enjoy, since your supplementary income might make the difference between not making ends meet and living very comfortably. It's a longer timeline, to be sure. but might be more satisfying.
|
# ? Jul 30, 2012 20:19 |
|
I just want to do whatever will look best on my resume for a couple of years before I run off to teach English in some other country for a couple years, so that I can find a job when I get back.
|
# ? Jul 31, 2012 02:46 |
|
I hate Maven. So, I have a project with a dependency tree that looks like this: [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ cloudmine-javasdk --- [INFO] com.cloudmine.api:cloudmine-javasdk:jar:0.3-SNAPSHOT [INFO] +- junit:junit:jar:4.10:compile [INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:compile [INFO] +- org.slf4j:slf4j-api:jar:1.6.4:compile [INFO] +- org.slf4j:slf4j-simple:jar:1.6.4:compile [INFO] +- commons-io:commons-io:jar:2.3:compile [INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.0.0-RC2:compile [INFO] | +- com.fasterxml.jackson.core:jackson-core:jar:2.0.0-RC2:compile [INFO] | \- com.fasterxml.jackson.core:jackson-annotations:jar:2.0.0-RC2:compile [INFO] +- joda-time:joda-time:jar:2.1:compile [INFO] +- org.apache.httpcomponents:httpcore:jar:4.2.1:compile [INFO] +- org.apache.httpcomponents:httpclient:jar:4.2.1:compile [INFO] | \- commons-codec:commons-codec:jar:1.6:compile [INFO] \- commons-logging:commons-logging:jar:1.1.1:compile and I have another project that depends on that jar [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ coderunner-test --- [INFO] com.bigcompany.snippets:coderunner-test:jar:0.0.1-SNAPSHOT [INFO] +- com.cloudmine.api:cloudmine-javasdk:jar:0.3-SNAPSHOT:compile [INFO] +- com.cloudmine:coderunner:jar:0.0.1-SNAPSHOT:compile [INFO] +- org.slf4j:slf4j-api:jar:1.6.4:compile [INFO] \- org.slf4j:slf4j-simple:jar:1.6.4:compile Notice that according to this javasdk has no transitive dependencies. I wouldn't be surprised if I'm just doing something stupid cause I never use Maven, but does anyone have an idea why it isn't resolving these transitive dependencies? Right now, unless I manually copy over the dependencies, the code fails at run time with a NoClassDefFoundError. If it matters, cloudmine-javasdk was manually added using mvn install:install-file.
|
# ? Aug 2, 2012 19:39 |
|
Safe and Secure! posted:I just want to do whatever will look best on my resume for a couple of years before I run off to teach English in some other country for a couple years, so that I can find a job when I get back. In a couple of years new technologies, methodologies and other crap will appear out there that will make your current experience pretty worthless. Oracle will close source Java and will ask 100k to anyone to even look at it, assembler will be the new best technology, etc. Don't work for your resume. Work for you.
|
# ? Aug 3, 2012 23:10 |
|
Ranma posted:I hate Maven. I'm pretty sure the pom files tell maven what the dependencies are and since you probably just provided the jar file (and not the pom) for javasdk it has no clue what its dependencies are.
|
# ? Aug 3, 2012 23:22 |
|
Kruegel posted:I'm pretty sure the pom files tell maven what the dependencies are and since you probably just provided the jar file (and not the pom) for javasdk it has no clue what its dependencies are.
|
# ? Aug 4, 2012 01:29 |
|
Kruegel posted:I'm pretty sure the pom files tell maven what the dependencies are and since you probably just provided the jar file (and not the pom) for javasdk it has no clue what its dependencies are. Sedro posted:Did you run mvn install:install-file off the jar or the pom?
|
# ? Aug 4, 2012 14:19 |
|
is it ok to ask jvm tuning stuff here? I'm having a thing where whenever permgen gets right around 70% full, cpu utilization goes nuts and everything gets ~5x slower. doesn't actually break, just slows way down. I can increase permgen, I can restart more often, but does anyone know if this is a predictable affect of some jvm default and there's an option I can tune to help? I already have -XX:+CMSClassUnloadingEnabled enabled. Also, is there any downside to doing something absurd like making permgen 4gb?
|
# ? Aug 6, 2012 05:41 |
|
Have you profiled the GC with jstat?
|
# ? Aug 6, 2012 16:55 |
|
trex eaterofcadrs posted:Have you profiled the GC with jstat? extensively. between me and three of the other guys we've probably spent a combined 50 hours starting at visualvm/visualgc
|
# ? Aug 7, 2012 13:31 |
|
Honestly that sounds like a bug. When the CPU spikes, can you tell if it's due to GC overhead?
|
# ? Aug 7, 2012 15:11 |
|
trex eaterofcadrs posted:Honestly that sounds like a bug. When the CPU spikes, can you tell if it's due to GC overhead? no, as in no I can't tell. I don't trust the graph in visualvm, and htop shows some erratic results I haven't found a pattern to. the only consistent pattern is when permgen gets to 70% full (which takes about 30 hot deploys) urls that used to respond in 25ms start responding in 100ms. only way to fix it is to kill the jvm and start a new one.
|
# ? Aug 10, 2012 02:24 |
|
A little tangent; if permgen is filling up during hot deploys then the app has a ClassLoader leak. I wonder if that might have something to do with it. I'm totally taking a shot in the dark here but if you can track down the leak, your app will be better for it anyhow.
|
# ? Aug 10, 2012 14:04 |
|
trex eaterofcadrs posted:A little tangent; if permgen is filling up during hot deploys then the app has a ClassLoader leak. I wonder if that might have something to do with it. I'm totally taking a shot in the dark here but if you can track down the leak, your app will be better for it anyhow. thats the hopefully-productive yak shaving path we've started down are there any good commandline/programatic ways to do it though? taking a several-gigs heap dump and downloading it to your laptop to futz around in the gui tools is gruelingly slow.
|
# ? Aug 11, 2012 06:23 |
|
Super newbie Swing question for a dumb final project for a class I'm taking! I have two JButtons and I want to change the icon of button 'B' when I press button 'A'. Is there a way to access the icon property of button 'B' in the actionPerformed method of button A's ActionListener? E: Nevermind, I'm dumb and figured out my question which opened up a few new ones that I may post. Schools are bad at teaching programming. Good Will Punting fucked around with this message at 18:23 on Aug 12, 2012 |
# ? Aug 12, 2012 17:47 |
|
StabbinHobo posted:thats the hopefully-productive yak shaving path we've started down Nothing automatic as far as I know but http://www.samaxes.com/2007/10/classloader-leaks-and-permgen-space/ is probably the most concise step by step I've found
|
# ? Aug 12, 2012 20:46 |
|
So the last time I significantly touched Java at all was when I was 10, using some book about Java 1. I have other programming experience, but can anyone recommend a book for learning it (preferably a free ebook)? Specifically I'm interested in getting into Android development, but I want to start with just learning Java now.
|
# ? Aug 13, 2012 12:42 |
|
MeramJert posted:So the last time I significantly touched Java at all was when I was 10, using some book about Java 1. I have other programming experience, but can anyone recommend a book for learning it (preferably a free ebook)? Specifically I'm interested in getting into Android development, but I want to start with just learning Java now. I would actually go with learning Android development from the start. You can pick up the Java you need as you go along, the instructions are from Google so they are straightforward, you'll get pretty pictures on the screen in short order and you'll start to learn how to get the most out of a modern IDE for Android and Java development while skipping manually compiling your code and fumbling with classpaths. The UI APIs are also different so there's not much point in writing a lot of Swing if you don't intend to start writing desktop Java applications. There's also the small caveat that Android is only at Java 6, not Java 7, and Java/Android are at a sort of legal impasse right now with Android not even using a regular JVM, so there's no telling when the latest stuff in Java 7 and up will start appearing in Android.
|
# ? Aug 13, 2012 14:40 |
|
How can I tell if a bug has been fixed in a Java version? The bug in question is this: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7080203
|
# ? Aug 13, 2012 20:29 |
|
mister_gosh posted:How can I tell if a bug has been fixed in a Java version? The bug in question is this: Well other than testing a version, see that "Release Fixed" field with a value of "8(b14)"?
|
# ? Aug 13, 2012 20:39 |
|
baquerd posted:Well other than testing a version, see that "Release Fixed" field with a value of "8(b14)"? Yes, I did see that, but for a serious-ish type regression like this, I would think it would have been patched into the major version. So Java 7 does not have the fix as far as I can tell.
|
# ? Aug 13, 2012 20:52 |
|
|
# ? May 9, 2024 22:31 |
|
Can't you just check for null || arr.length == 0 or is 0-len a valid condition?
|
# ? Aug 13, 2012 20:55 |