• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Query Regarding SCJA

 
Sameer Mhaskar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Group.
First of All Thank You All.
I did my SCJA Yestarday and did well.I could do it because of u guys.This forum has really helped me.THANK YOU again.
I have some queries...
1.How the multiple answer questions are assesses??? If one out of two answers is right then will I get Half of the Marks assigned to that question OR I will loose All the Marks???
2.Can we declare an Abstract class without any Abstract methods???
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sameer Mhaskar:
1.How the multiple answer questions are assesses??? If one out of two answers is right then will I get Half of the Marks assigned to that question OR I will loose All the Marks???

As far as I know, even one choice is wrong in two answers, you won't get mark for that question. But I am not sure whether the checkbox-typed questions and radio-typed questions carry the same mark or not. Someone out here, who is closed to exam grading team at Sun, might be able to give you some info about the grading system.
2.Can we declare an Abstract class without any Abstract methods???

Yes, we can. We can defintely have an abstract class, which does not have an abstract method. But if there is an abstract method inside a class, that class must be declared abstract.
 
Arulkumar Gopalan
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ko Ko Naing:

Yes, we can. We can defintely have an abstract class, which does not have an abstract method.


What is the purpose of having an abstract class with out having any abstract methods?
 
Dave Wood
bronco
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Each question is either right or wrong. If you are told to select 4 correct answers, you must choose all 4 correctly or your answer will be considered incorrect. All questions are weighted equally.

2. Answer by example...perhaps you have an interface with 10 methods in it and you want to define a default implementation for these methods (perhaps one that does nothing). This default implementation is useless on its own, so you might choose to declare it abstract (so nobody tries to instantiate it) even though you've provided an implementation for all of the methods.

For an example from the SDK, see MouseAdapter

HTH,
-Dave
 
sai kumar
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the purpose of having an abstract class with out having any abstract methods?


In object-oriented programming, you may want to model an abstract concept without being able to create an instance of it. For example, the Number class represents the abstract concept of numbers. It makes sense to model numbers, but it doesn't make sense to create a generic number object. Instead, the Number class makes sense only as a superclass to such classes as Integer and Float, both of which implement specific kinds of numbers. A class such as Number, which represents an abstract concept and should not be instantiated, is called an abstract class. An abstract class can only be subclassed.

Reference: http://java.sun.com/docs/books/tutorial/java/javaOO/abstract.html
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Arulkumar Gopalan:


What is the purpose of having an abstract class with out having any abstract methods?


Simply, recall the purpose of an abstract class.

Just to prevent people from instantiating an instance from that class. To be able to instantiate, it is a must to subclass it with a concrete class.
 
Arulkumar Gopalan
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I know that abstract classes can not be instantiated. But, am not convinced that abstract should be used for that, instead of achieving it's original concept of polymorphism.

But, i understand now this is also a purpose from the below explanation.

Sometimes, a class that you define represents an abstract concept and, as such, should not be instantiated. Take, for example, food. Have you ever seen an instance of food? Probably not. What you see instead are instances of carrot, apple, and chocolate chip cookies. Food represents the abstract concept of what we can eat. It doesn't make sense for an instance of food to exist.

thx.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic