Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,668 members, 7,955,418 topics. Date: Sunday, 22 September 2024 at 04:50 AM |
Nairaland Forum / Science/Technology / Programming / Can Someone Help To Demonstrate The Step By Step To Run This Java Code (666 Views)
Help Me Solve This Java / Can Someone Help Me Run This Java Code (java Programmers) / Improve The Speed Of This Java Code. (2) (3) (4)
(1) (Reply)
Can Someone Help To Demonstrate The Step By Step To Run This Java Code by buster(m): 5:09pm On Dec 20, 2014 |
Am getting an error message of cannot find main class. Can anyone help class Box { double width; double height; double depth; Box() { } Box(double w, double h, double d) { width = w; height = h; depth = d; } void getVolume() { System.out.println("Volume is : " + width * height * depth); } } public class MatchBox extends Box { double weight; MatchBox() { } MatchBox(double w, double h, double d, double m) { super(w, h, d); weight = m; } public static void main(String args[]) { MatchBox mb1 = new MatchBox(10, 10, 10, 10); mb1.getVolume(); System.out.println("width of MatchBox 1 is " + mb1.width); System.out.println("height of MatchBox 1 is " + mb1.height); System.out.println("depth of MatchBox 1 is " + mb1.depth); System.out.println("weight of MatchBox 1 is " + mb1.weight); } } |
Re: Can Someone Help To Demonstrate The Step By Step To Run This Java Code by luksybee(m): 8:35pm On Dec 20, 2014 |
On my quick scan, one of your curly bracket is missing. If you are using a good IDE, it should give you an indication |
Re: Can Someone Help To Demonstrate The Step By Step To Run This Java Code by naira4doll(m): 4:05pm On Dec 21, 2014 |
Your curly Brackets have issues... will run the code later and get back to you |
(1) (Reply)
How To Check If A Value Is A Number In Javascript / I Need To Have A Program Written. I Need Some Consultation. / URGENT: Please I Need A Programmer Asap Before 19th Of May
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 8 |