473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

why do I get the error illegal start of expression in my code

18
please help

Expand|Select|Wrap|Line Numbers
  1. import java.util.*;
  2.  
  3.  
  4.  
  5.  
  6. public class Vehicle
  7. {
  8.  
  9.   maxSpeed ms;
  10.   mark m;
  11.   regNumber rn;
  12.  
  13.   public static void main(String []args)
  14.   {  
  15.    int maxSpeed;
  16.    String mark;
  17.    String regNumber;
  18.  
  19.   public Vehicle()
  20.    {
  21.        int maxSpeed = new maxSpeed();
  22.        String mark = new mark();
  23.        String regNumber = new regNumber();
  24.     }
  25.  
  26.     public Vehicle(int maxSpeed, String mark, String regNumber)
  27.     {
  28.        this.maxSpeed=maxSpeed;
  29.        this.mark=mark;
  30.        this.regNumber=regNumber;
  31.     }
  32.  
  33.     public void setmaxSpeed(int speed)
  34.     {
  35.         this.maxSpeed=maxSpeed;
  36.     }
  37.  
  38.     public int getmaxSpeed()
  39.     {
  40.         return maxSpeed;
  41.     }
  42.  
  43.     public void setmark(String mark)
  44.     {
  45.         this.mark=mark;
  46.     }
  47.  
  48.     public String getmark()
  49.     {
  50.         return mark;
  51.     }
  52.  
  53.     public void setregNumber(String regNumber)
  54.     {
  55.         this.regNumber=regNumber;
  56.     }
  57.  
  58.     public String getregNumber()
  59.     {
  60.         return regNumber;
  61.     }
  62. }
  63.  
Dec 24 '15 #1
1 1955
aswal
38
Errors:
  • Closing brace of main method is missing

There are many others also but for that you have to document the code well ans tell about the realated classes.
Jan 2 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: MB | last post by:
Hi, I am using a web service to call an asp page on a remote server via System.Net.WebClient . The asp page returns a xml stream persisted from a recordset. I am having problems converting the...
1
by: amitbadgi | last post by:
I am geting the following error while conv an asp to asp.net Exception Details: System.Runtime.InteropServices.COMException: Syntax error in query expression 'id =System.__ComObject'. Source...
2
by: dobbouk | last post by:
I'm getting these 2 errors and haven't got a clue whats causing them please java 43: illegal start of type for (i=0;i< Number_of_squares; i++) java 215 identifier expected } ...
4
by: rajesh619 | last post by:
I'm new to programming. I have created a servlet which retrieves values from the database after a value is put into the HTML page to which it is attached. But during compilation, it shows two errors....
2
by: mole40 | last post by:
Hello! I'm very new to writing java. And I keep getting the "Illegal Start of Type" error. I've tried everything to fix it. can anyone help me? import java.util.*; class ClockTalk { public...
1
by: aflow | last post by:
Hello! I downloaded java now twice, tested fine, enabled it & javascript in Firefox options, & from that time, whenever I visit Twitter & click on ANYTHING in Twitter, a small window that says...
1
by: John Luttig | last post by:
import java.awt.*; import java.awt.event.* ; import java.awt.image.*; import java.awt.geom.* ; import javax.swing.* ; import javax.swing.event.* ; public class NPCObject { public void...
2
by: Christina Arena | last post by:
I'm just starting to learn java as part of a class I am required to take as a math major. I am feeling completely lost. I guess we're supposed to learn this as independently as possible. I was...
1
by: Mani loveypal | last post by:
I am getting an error: Illegal start of expression in line no 5 public static void main Could you please explain what I'm doing wrong. Here is my code: //Demonstrate continue class...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.