Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

runtime error

I already know C++, and to me this error seems like a linking error. I'm using the Windows command line to compile and run it. When I run it it gives me the error "Exception in thread 'main' java.land.UnsupportedClassVersionError: DemoD (Unsupported major.minor version 49.0)" and then a bunch of stuff below it.

This is DemoD.java

public class DemoD
{
public static void main(String[] args)
{
//declare and create point obj and 2 rect obj's
Point originOne = new Point(23,94);
Rectangle rectOne = new Rectangle(originOne, 100,200);
Rectangle rectTwo = new Rectangle(50,100);

System.out.println("Width of rectOne: " + rectOne.width);
System.out.println("Height of rectOne: " + rectOne.height);
System.out.println("Area of rectOne: " + rectOne.area());

//set rectTwo's position
rectTwo.origin = originOne;

//display rectTwo's position
System.out.println("X Position of rectTwo: " + rectTwo.origin.x);
System.out.println("Y Position of rectTwo: " + rectTwo.origin.y);

//move rectTwo and display its new position
rectTwo.move(40,72);
System.out.println("X Position of rectTwo: " + rectTwo.origin.x);
System.out.println("Y Position of rectTwo: " + rectTwo.origin.y);
}
}
Sign In or Register to comment.