Hey Guys I don't get what I need to add Im fairly new in Java.

this is my code but it gives me these below the line errors below

import javax.swing.*;

public class Movies
{
	private String name;
	private double price;
	private int year;
	
	public Movies
	{
		name="";
		price=0.0;
		year=0;
	}
	
	public Movies(String name,double price,Int year)
	{
		this.name = name;
		this.price = price;
		this.year =year;
		
	}
	
	string getname()
	{
		return name;
	}
	
	doube getprice()
	{
		return price;
	}	
	
	int getyear()
	{
		return year;
	} ;
}
	
	public void double adjust()
	{
		
		if(year<2000)
		price = price-(price*0.15);
		
		else if(year =<2005)
		price = price-(price*0.1);
		
		else if(year =<2009)
		price = price-(price*0.05);
		
	}

________________________________________________________________________________
C:\Program Files\Xinox Software\JCreator LE\MyProjects\Object.java:10: <identifier> expected
{
^
C:\Program Files\Xinox Software\JCreator LE\MyProjects\Object.java:40: 'class' or 'interface' expected
public void double adjustPrice()
^
2 errors

Process completed.

Edited 6 Years Ago by peter_budo: Keep It Clear - Do wrap your programming code blocks within [code] ... [/code] tags

Like JamesCherril said, you have no parentheses on your default contrsuctor.
Also,

public void double adjust()
{

Can't be void and double at the same time. Void means the method takes no arguments

Edited 6 Years Ago by Akill10: n/a

Small slip of the keyboard there? Void means the method returns no value.

Ha! That's what i originally had written. I just remember thinking about empty spaces when I read 'void' and I edited accordingly! :)

This article has been dead for over six months. Start a new discussion instead.