Hay guys, I started learning Java, the first code (well second, I had a basic knowledge of Java some time ago and created a simple calculator, but that's long gone) I made got 9 errors, it was only 5 lines. The Tutorial I'm following is a from 2010 so that's what I'm guessing is the problem but here's my code and the errors I got when compiling, if you have any idea on why this code isn't working please help me. Code: Errors :c :
I know java, but not at 2 am. Lemme answer you in the morning. Pretty much your class name isn't an acceptable one, and you're throwing semicolons where they don't belong. I'll fix it tomorrow
Cool, any help would be appreciated, if I still had the Java Source File for my calculator I could just go off that but I can't find it, all I have are the .class'es
The problem isn't the tutorial, unless it's just a really bad tutorial. Try this site for practice, it shows you the answers if you need help: www.codingbat.com All the errors are stemming from your class not being properly defined. (it can't be a number, either). Also, because println is a method, not a variable, it cannot equal something. Instead, you put "hay thar" in parentheses behind println, without an equals sign. Also, out of habit, and because it's easier for bigger programs, I put 'public' in front of my class. That's not necessary. This is how I would write the code: Code: public class HelloWorld { public static void main(String args[]) { System.out.println("Hello world!"); } }
Thanks! Oh and the tutorial was fine, I really don't know why I put an = sign there, it didn't tell me to. And it didn't clarify that a class name couldn't be a number.
As far as I know, class names, variable names, and method names must start with a letter (capital for classes, lowercase for methods/variables), and maybe (?) a dollar sign. But that's some complicated juju. You could have done class C1 and it would have worked.
Macs are much easier to use. It has AMAZINGLY good fps never lags good audio. Your can drag stuff to window to window much easier which is good for mods. How do you beat that?
It's only easy to use if your not planning on doing much tech savvy things on it. you can drag stuff window to window in Windows too.
Mac is way way better then PC. It is much easier to use. My Mac never crashed, unless i was running a Microsoft program. PC is nice because you have more options to customize it, but most people don't customize their computers anyway. I would rather have a computer that just works and does what i want, without it being complicated. In my experience the mac turns on faster then the PC, i don't have to wait for windows to load. I know for a while Macs really sucked. I think that gave them a really bad name and is why so many PC users are so against them.
cause they suck a lot of popular programs/games aren't even compatible with macs. mac's have great hardware (flash ROM/RAM) but it's the OS that matters I quote my computer teacher
I don't really like the price of Macs either, and I also do a lot more "techy" stuff on my computer, like I have been learning Java, which is possible on Mac, BUT I have also been learning C# (for Xbox App development) which isn't possible.
they are too mainstream. you see them in all of the movies (when they aren't doing techy stuff ) like jeffie just said, macs are a lot more expensive for not that much more I choose 1 macbook and 1 ultra book pretty similar macbook ultrabook first off the apple page barely give you info, while the pc page give you just about everything you need to know. The only difference i can see without straining my efforts is that the mac has 372 more gb of hard drive space and 1.4 ghz(pc) 3.1 ghz (mac) cpu with a price difference is $300 (you can easily get a 1TB external hard drive for that much). so really the only bonus is the cpu. And if you go to amazon you can get an even better deal. amazon laptops tl;dr macs are expensive as hell and pcs are better
Fun Fact! all apple products are made in a chinese factory called foxconn! the people that work there live about 4 people to a room that is 8 feet by 6 feet. they work standing 14 hours a day, for on average less than or right around a dollar or two a day. the people *chinese laborers* would get so upset at the condition of their lives that they would jump off of the factories roof to kill themselves. apples management issued an order to have NETS hung from the roof so that any one trying to kill themselves would be caught in the net, and sent right back to work. children as old as 7 have also been caught working in foxconn. thats the main reason i dont buy anything more than 200$ from them, because cheaper, better and more moral options are available. plus, i love customizing my laptop! in highschool there is so much i have to do with this thing that i want it to feel like its mine. and my cousin has one, when he wants to install stuff or look into his computers hardware, its almost impossible and super hard to do. and you cant take music from your ipod and put it on your mac without opening up its firewalls and such. thats reason 2