JavaScript does not use classes in the same way as Java, C++ or the like.
One way to achieve your effect is to define a function in which the this keyword is used--accessing members roughly as you would in Java. Then, use the new keyword in calling this function to create an object.
function Foo(){ //vaguely like a Java constructor
this.aField = 1; //define members simply by using 'this'
this.aMethod = methodFunction; //assign a function as a member using 'this'
}
function methodFunction(){
}
var foo = new Foo(); //construct an object