Mark K

Greenhorn
+ Follow
since Jan 20, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mark K

I am a raw beginner both on this forum and in Java. As an old top/down GWBASIC programmer who is trying to learn how to program in the modern world I see one HUGE advantage to Java...

It is object oriented from the very beginning programming levels. I've looked at some other languages and bought books to attempt to learn them. I get started just fine and then, halfway through the book, they switch gears to object oriented programming. It screws up my whole thought process.

I'm not sure about other books, but "Head First Java" starts you out learning about objects. My understanding is that everything is an object. It helps to learn this from the beginning. I'm not quite halfway through the book, but I've learned more about objects than ever before and much easier to boot! It actually helps clear up things that I was attempting to understand in other languages.

So I guess the learning curve is not so steep. (I know, just wait for the next half of the book!)
17 years ago
Thanks guys. It's nice to find a place like this where I'll be able to get help. No wonder it's one of the first things they tell you about in the book! I really appreciate good communities. They are an invaluable resource in almost any endeavor. I look forward to being part of it.

Mark
17 years ago
I think you might both be correct. Thanks Marc. It did compile after you corrected my syntax. I cannot run it though. When I try java Party, I get this error:

Exception in thread "main" java.lang.NoSuchMethodError: main
17 years ago
Thanks Katrina. I wondered about that, but since they showed a resulting screen, I thought they meant for it to run. I guess I should have known it wouldn't be THAT easy. Ok. I'll let that one slide as my stupid question for the day and move on.

I'm looking forward to getting into programming again. It's been a long time. The last programs I actually wrote were in BASIC back when it had line numbers! I think I have a lot to learn

Mark
17 years ago
I didn't think I'd be asking for help with the first example in my book! I'm using Head First Java v2. I have installed java5 (1.6) on my ubuntu linux laptop. The short program is as follows:

import java.awt.*;
import java.awt.event.*;

class Party{
public void buildInvite(){

Frame f=newFrame();
Label l=newLabel("Party at Tim's");
Button b=newButton("You Bet");
Button c=newButton("Shoot Me");
Panel p=newPanel();
p.add(l);
} //more code here...

The errors when I try to compile using javac are:

mark@personalpc:~/HeadFirst$ javac Party.java
Party.java:7: cannot find symbol
symbol : method newFrame()
location: class Party
Frame f=newFrame();
^
Party.java:8: cannot find symbol
symbol : method newLabel(java.lang.String)
location: class Party
Label l=newLabel("Party at Tim's");
^
Party.java:9: cannot find symbol
symbol : method newButton(java.lang.String)
location: class Party
Button b=newButton("You Bet");
^
Party.java:10: cannot find symbol
symbol : method newButton(java.lang.String)
location: class Party
Button c=newButton("Shoot Me");
^
Party.java:11: cannot find symbol
symbol : method newPanel()
location: class Party
Panel p=newPanel();
^
5 errors


I am assuming this means the compiler cannot find the import modules (?).
If this is the case, I can't find a file on my system called java.awt.

I do have a ham radio logging program that runs in the VM so I assume my environment is set up ok.

Thanks for any help.

Mark
17 years ago