Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials


 

 

Struts Tutorials

Struts Resources

Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Java Programming MCQs Answers Required, Help Askproblem

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

;
 
Java Examples for Beginners
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (post your own) View All Comments Latest 10 Comments:

java MCQs

The keyword this is used to
1. Invoke constructor of the another class
2. Invoke alternate constructor of the same class
3. Invoke constructor of super class form sub class
4. Invoke constructor of sub class from supper class
Which of the following syntax attaches on output stream to console?
1. FileWriter fw=newFileWriter[output.text]
2. FileWriter fw=newFileWriter[fileDescription.out]
3. FileWriter fw=newFileWriter[fileDescriptio.in]
4. FileWriter fw=newFileWriter[fileDesciptor]
What will happen if main method is declared as private?
1. The program does not compile
2. The program throws an exception at runtime
3. The program complies and runs successfully
4. Non of given
What will happen if static modifier is removed from the signature of main method?
1. The program does not compile
2. The program compile and runs successfully
3. The program compile but does not run
4. Non of given
Which of the following methods are invoked by the AWT to support paint and repaint operations?
► paint( )
► repaint( )
► draw( )
► redraw( )
When defining a method you must include a ___________ to declare any exception that might be thrown but is not caught in the method.
► try block
► finally block
► catch block
► throws-clause
Aside from the Scanner class, which of the following classes can be used for text-file file input?
► ObjectInputStream
► BufferedReader
► StringTokenizer
► None of these
Which of the following statements is true regarding Vectors with no specified base type?
► A base type is needed, because Java needs to know how to allocate memory.
► No base type is needed, because Java will use the Object class as a base type.
► If a base type is not specified the code will not compile.
► No base type is needed because Vectors default to storing String objects.
A serializable class must implement the method(s) _________.
► readObject and writeObject
► Either readObject or writeObject, or both, depending upon the desired behavior
► No need to implement any method
► None of the given option
Which of the following are passed as an argument to the paint ( ) method?
► A Canvas object
► A Graphics object
► An Image object
► A paint object
The code below draws a line. What color is the line?
g.setColor(Color.red.green.yellow.red);
g.drawLine(0, 0, 100,100);
► Red
► Green
► Yellow
What if the static modifier is removed from the signature of the main method?
► The program does not compile
► The program compiles but does not run
► The program compiles and runs properly
► The program throws an exception on compile time
What if the main method is declared as private?
► The program does not compile
► The program compiles but does not run
► The program compiles and runs properly
► The program throws an exception on compile time
A member variable or method prefixed by the protected access modifier can be accessed:
► Within the same class
► Within the sub-class
► Within the same package
► All of the above
Which of the following is modifier is provided by default if no access is written explicitly?
1. public
2. Private
3. Protected
4. Default
This is used to ________
1. Invokes constructor of another class
2. Invokes alternate constructor from same class
3. Invokes constructor of super class from sub class
4. Invokes constructor of sub class from super class
In Java a final class must be sub-classed before it.
True/ False
A top level class without any modifier is accessible to
1. any class
2. any class within the same package
3. any class within the same file
4. any subclass of this class
A top level class may have only the following access modifier.
1. Package
2. Private
3. Protected
4. Public
In Java an abstract class cannot be sub-classed
True / False
Given a one dimensional array arr, what is the correct way of getting the number of elements in arr
1. arr.length
2. arr.length 1
3. arr.size 1
4. arr.length()
When recursive method is called to solve a problem, the method actually is capable of solving only the simpler case(s), or base case(s).
True / False
Which of these are valid declarations for the main method?
1. public void main();
2. public static void main(String args[]);
3. static public void main(String);
4. public static int main(String args[]);
Map interface is derived from the Collection interface.
True / False
In Java, which of these classes implement the LayoutManager interface?
1. RowLayout
2. ColumnLayout
3. GridBagLayout
4. FlowLayoutManager
BorderLayout is the default layout manager for a JFrames content pane
True / False
_________ define behavior and ____________ define implementation
Java program code is compiled into form called
1. Machine code
2. native Code
3. Byte Code
4. Source Code

Posted by nasir on Sunday, 05.30.10 @ 11:54am | #97272

Ask programming questions?

 

 

Back to Tutorial
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name

 

 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright 2007. All rights reserved.