A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Certification
»
Programmer Certification (SCJP/OCPJP)
Author
KB question pg 409
Dinesh Tahiliani
Ranch Hand
Joined: Aug 06, 2007
Posts: 486
posted
Jun 24, 2008 11:20:00
0
class Mineral{}
class Gem extends Mineral
{}
class Miner
{
static int i =8;
static
String
s = null;
public static void getWt(Mineral m)
{
int y=0/x;
Sysytem.out.println(s);
public static void main(String a[])
{
Mineral ma[]= {new Mineral(), new Gem()};
for(Object o : ma)
getWt((Mineral) o);
comandline
java
Miner.java
gives error
NoClassDefFoundError
Please explain why??
Thanks<br />Dinesh
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 10043
6
I like...
posted
Jun 24, 2008 11:56:00
0
try "java Miner"
Never ascribe to malice that which can be adequately explained by stupidity.
Dinesh Tahiliani
Ranch Hand
Joined: Aug 06, 2007
Posts: 486
posted
Jun 24, 2008 11:59:00
0
I tried it worked.
But wht was the reason
Dinesh Tahiliani
Ranch Hand
Joined: Aug 06, 2007
Posts: 486
posted
Jun 24, 2008 12:42:00
0
if i pass java Miner diamond
what will be the output??
Bert Bates
author
Sheriff
Joined: Oct 14, 2002
Posts: 8717
posted
Jun 24, 2008 14:19:00
0
Hey Dinesh,
What part of the answer in the book was confusing to you?
Ber
Eliminate fossil fuel subsidies. (If you're not on the edge, you're taking up too much room.)
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12956
3
I like...
posted
Jun 25, 2008 01:15:00
0
Originally posted by Dinesh Tahiliani:
I tried it worked.
But wht was the reason
The "java" launcher expects a class name (such as "Miner") as the argument. Not the name of a Java source code file ("Miner.java").
Java Beginners FAQ
-
JavaRanch SCJP FAQ
-
The Java Tutorial
-
Java SE 7 API documentation
Scala Notes
- My blog about Scala
I agree. Here's the link:
http://aspose.com/file-tools
subject: KB question pg 409
Similar Threads
Question from K&B Chapter 5
object reference
Why null null?
BinarySearch
K&B Master Exam SCJP6 class mineral question: why is the answer 'null null'
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter