This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Java Quiz

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
1.An object (Select all correct answers)
a)is initialized by a constructor
b)is an instance of a class
c)can be accessed in an application via the object reference
d)can exhibit behavior that is not defined via its class.


2.If you extend a class, you are
a)allocating more memory to the class
b)making the class more specific
c)creating extra instances of the class.
d)creating a superclass


3.What is true about constructors? (Select two)
a) They initialize all the member variables
b) They initialize all the instance variables
c) If there is no constructor, the compiler includes default constructor.
d) Compiler supplied constructor will invoke the default constructor of the Super class.


4.A final class cannot have abstract methods.
a) True
b) False
c) True, only if the class is sub-classed.
d) True, only if the class is static.


5.In Java, an abstract class cannot be sub-classed.
A. True
B. False


6.All the methods of an interface are abstract by default.
a)True
b)False
c)True, Only if the class is sub-classed.
d)True, Only if the class is static.


7.Which of the following class declarations are INCORRECT uses of modifier keywords? (Select all correct answers)
a)public synchronized class FastClass extends Thread
b)private protected class FastClass
c)public abstract class FastClass
d)class FastClass extends Thread


8.How will you specify the access modifier for a method, which should be accessible only to the class in which it is defined?
a) protected
b) static
c) private
d) default
e) final
f) abstract


9.Which of the follow modifiers are legal for an interface method (circle all)?
a)Public
b)Private
c)Synchronized
d)Protected
e)none of the above


10.Every Java source file should be stored with the extension, �.java�?
a)True
b)False

11.Which of the following would be an illegal identifier for a Java variable
a)My_stuff
b)_yourstuff
c)$mymoney
d)%path
e)2good


12.What is the output of this code fragment?
int X=3; int Y =10;
System.out.println(y%x);
a)0
b)1
c)2
d)3
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Report post to moderator
Whats "Your" question Atul??? and this place is for servlets i guess....
 
Marshal
Posts: 67340
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
You'll need to look elsewhere to get your homework done for you.
 
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Yes, what Bear said. I am just going to close this thread. i am not even going to move it to the more appropriate forum.

This forum is for Servlets questions only.

Thank you.

Mark
 
Mark Spritzler
ranger
Posts: 17344
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
"Happy"-
Welcome to the JavaRanch! Please adjust your displayed name to meet the

JavaRanch Naming Policy.

You can change it

here.

Thanks! and welcome to the JavaRanch!

Mark
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!