This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

problem witn code from Head First Java

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm beginig with Java. Tried to do the first code from first chapter. After creating of the class Party I used JVM. And got error: main method not found in class party. please define the main method as: public static void main<String[] args> or a JavaFX application class must extend javafx.application.Application
What have I done wrong?

 
Greenhorn
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Sheriff
Posts: 7123
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, wu and Egor!

Egor: Head First Java often leaves out this kind of "boilerplate" code so that the examples are shorter.

wu: Thanks for the solution. Just so you know, we usually don't give complete solutions here, but instead offer advice to help the OP arrive at their own conclusion -- although snippets of code are fine. Also, you should UseCodeTags (that's a link). It makes your code look much better. I'll put them in for you this time.
 
Egor Korenevski
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you.
 
Ranch Hand
Posts: 270
15
Android Angular Framework Spring AngularJS Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Egor,
Please checkout the Java Tutorials http://docs.oracle.com/javase/tutorial/ if you get frustrated with "Head First". I have not used Head First, since one early attempt with Java EJBs, but I have frequently found answers for various things in the tutorials.
 
Marshal
Posts: 76825
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The two are different. HFJ is a teaching book intended for not‑quite‑beginners. The Java™ Tutorials are probably the most comprehensive such source available. But has quite short examples.

The Party app in the early chapters of HFJ is notorious because it is incomplete and cannot be executed without adding quite a lot of code.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How I can run the same on IntelliJ Idea IDE Platform?
 
Campbell Ritchie
Marshal
Posts: 76825
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can only use it if you create a class to use it with, maybe called PartyDemo. I would change all the old AWT display classes to their Swing or FX counterparts, e.g. Frame→JFrame.

And welcome to the Ranch
 
He puts the "turd" in "saturday". Speaking of which, have you smelled this tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic