I want some code snippets of java

G

gudia

to practise for my exam relating to
static,abstract,overloading,overriding.can smbody help plz
 
J

Jeff Higgins

gudia wrote
to practise for my exam relating to
static,abstract,overloading,overriding.can smbody help plz

import java.util.HashSet;
import java.util.Set;


public class Exam {

private static final String ExamHeader = "Exam";


public static void main(String[] args) {

StringBuffer exam = new StringBuffer();

}


public static abstract class AbstractQuestion {

public abstract String getQuestion();

}

public static final class MultipleChoiceQuestion
extends AbstractQuestion {


public static final Set<String> defaultChoices;

static {
defaultChoices = new HashSet<String>();
defaultChoices.add("Yes");
defaultChoices.add("No");
defaultChoices.add("All of the above.");
}

public String getQuestion() {
return null;
}

public String getQuestion(int choiceCount) {
return null;
}

public String toString() {
return super.toString();
}

}

}
 
O

Owen Jacobson

gudia wrote
to practise for my exam relating to
static,abstract,overloading,overriding.can smbody help plz

import java.util.HashSet;
import java.util.Set;

public class Exam {

  private static final String ExamHeader = "Exam";

  public static void main(String[] args) {

    StringBuffer exam = new StringBuffer();

  }

  public static abstract class AbstractQuestion {

    public abstract String getQuestion();

  }

  public static final class MultipleChoiceQuestion
  extends AbstractQuestion {

    public static final Set<String> defaultChoices;

    static {
      defaultChoices = new HashSet<String>();
      defaultChoices.add("Yes");
      defaultChoices.add("No");
      defaultChoices.add("All of the above.");
    }

    public String getQuestion() {
      return null;
    }

    public String getQuestion(int choiceCount) {
      return null;
    }

    public String toString() {
      return super.toString();
    }

  }

}

Too complicated. Here's mine:

;
 
J

Jeff Higgins

Owen Jacobson wrote:

Too complicated. Here's mine:

;
With the realization of their equivalence,
he will now practise reducing my
complicated snippet to your simple one.
 
R

rossum

gudia wrote
to practise for my exam relating to
static,abstract,overloading,overriding.can smbody help plz

import java.util.HashSet;
import java.util.Set;


public class Exam {

private static final String ExamHeader = "Exam";


public static void main(String[] args) {

StringBuffer exam = new StringBuffer();

}


public static abstract class AbstractQuestion {

public abstract String getQuestion();

}

public static final class MultipleChoiceQuestion
extends AbstractQuestion {


public static final Set<String> defaultChoices;

static {
defaultChoices = new HashSet<String>();
defaultChoices.add("Yes");
defaultChoices.add("No");
defaultChoices.add("All of the above.");
defaultChoices.add("None of the above.");
// See Nargajuna for details.
 
J

Jeff Higgins

rossum wrote>
defaultChoices.add("None of the above.");

Like a dream, like an illusion,
Like a city of Gandharvas,
So have arising, abiding,
And ceasing been explained.

Thanks.
 
R

rossum

rossum wrote>

Like a dream, like an illusion,
Like a city of Gandharvas,
So have arising, abiding,
And ceasing been explained.

Thanks.
Samsara does not have the slightest distinction from Nirvana.
Nirvana does not have the slightest distinction from Samsara.

Whatever is the end of Nirvana, that is the end of Samsara.
There is not even a very subtle slight distinction between the two.

rossum
 
L

Lew

Jeff said:
rossum wrote>

Like a dream, like an illusion,
Like a city of Gandharvas,
So have arising, abiding,
And ceasing been explained.

I prefer those two choices to be offered in the opposite order:

Philosophy 301 - Principles of Zen, Final Exam

Fill in the blank:
"The truth that can be spoken ______ the real truth."
A - is
B - is not
C - is and is not
D - none of the above
E - all of the above
 
J

Jeff Higgins

rossum wrote
Samsara does not have the slightest distinction from Nirvana.
Nirvana does not have the slightest distinction from Samsara.

Whatever is the end of Nirvana, that is the end of Samsara.
There is not even a very subtle slight distinction between the two.
I tend to be more touchy-feely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top