The Artima Developer Community
Sponsored Link

Java Answers Forum
need help with illegal start of type error

2 replies on 1 page. Most recent reply: Sep 28, 2009 3:16 AM by Kondwani Mkandawire

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Yessir Please

Posts: 2
Nickname: wowser99
Registered: Sep, 2009

need help with illegal start of type error Posted: Sep 26, 2009 9:10 AM
Reply to this message Reply
Advertisement
hi there, i am very new to java and my teacher isnt very helpful, i was wondering if anyone new what was wrong with this code, as bluej is telling me its an illegal start of type when i try to compile it.


Yessir Please

Posts: 2
Nickname: wowser99
Registered: Sep, 2009

Re: need help with illegal start of type error Posted: Sep 26, 2009 9:12 AM
Reply to this message Reply
oh and here's the code(the h's and p's are suppose to make big letters out of smaller letters, but they wont show up well on this)
/**
*MyInitials prints my initials
*
*@author Harrison Place
*@Version P2-1
*/
class MyInitials
{
type
a
;
* public class MyInitials{a
* public static void main(String[] args){//
* {//main method beginning
* System.out.print("My name is Harrison Place");
* System.out.printIn("and my initials are:\n\n");
*
* System.out.println("HHHH HHHH PPPPPPPPPPPP");
* System.out.println("HHHH HHHH PPPP PPPP");
* System.out.println("HHHH HHHH PPPP PPPP");
* System.out.println("HHHH HHHH PPPP PPPP");
* System.out.println("HHHHHHHHHHH PPPPPPPPPPPP");
* System.out.println("HHHHHHHHHHH PPPPPPPPPPPP")'
* System.out.println("HHHH HHHH PPPP");
* System.out.println("HHHH HHHH PPPP");
* System.out.println("HHHH HHHH PPPP");
* System.out.println("HHHH HHHH PPPP");
* }ends main(public static void)
* }ends class(public)

Kondwani Mkandawire

Posts: 530
Nickname: spike
Registered: Aug, 2004

Re: need help with illegal start of type error Posted: Sep 28, 2009 3:16 AM
Reply to this message Reply
> oh and here's the code(the h's and p's are suppose to make
> big letters out of smaller letters, but they wont show up
> well on this)
> /**
> *MyInitials prints my initials
> *
> *@author Harrison Place
> *@Version P2-1
> */
> class MyInitials
> {
> type
> a
> ;
> * public class MyInitials{a
> * public static void main(String[] args){//
> * {//main method beginning
> * System.out.print("My name is Harrison Place");
> * System.out.printIn("and my initials are:\n\n");
> *
> * System.out.println("HHHH HHHH
> PPPPPPPPPPPP");
> * System.out.println("HHHH HHHH PPPP
> PPPP");
> * System.out.println("HHHH HHHH PPPP
> PPPP");
> * System.out.println("HHHH HHHH PPPP
> PPPP");
> * System.out.println("HHHHHHHHHHH PPPPPPPPPPPP");
> * System.out.println("HHHHHHHHHHH PPPPPPPPPPPP")'
> * System.out.println("HHHH HHHH PPPP");
> * System.out.println("HHHH HHHH PPPP");
> * System.out.println("HHHH HHHH PPPP");
> * System.out.println("HHHH HHHH PPPP");
> * }ends main(public static void)
> * }ends class(public)

If this is your code in its entirety, your Syntax is incorrect. Google "Java Hello World"

Replace each System.out.println("Hello, World"); with your HHH stuff. Copy and paste the lines below Hello World - you will then get the idea of what System.out.println() does and you will also understand the structure of a Java Class.

Flat View: This topic has 2 replies on 1 page
Topic: Java Interface Previous Topic   Next Topic Topic: Finger print Recognition using JAVA [urgent]

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use