-
-
-
An interface contains _________ methods
Skill/Topic: InheritanceA) AbstractB) Non-abstract C) Implemented D) Un-implemented
-
Which of the following methods cause the String object referenced by s to be changed? (Select multiple)
A) s.concat( )B) s.toUpperCase( )C) s.replace( )D) s.valueOf( )
-
What is the difference between a Choice and a List
A Choice is displayed in a compact form that requires you to pull it down to see the listof availablechoices. Only one item may be selected from a Choice. A List may be displayed in such away that severalList items are visible. A List supports the selection of one or more List items.
-
-
Which of the following declare an array of string objects? (Select Multiple)
A) String[ ] s;B) String [ ]s:C) String[ s]:D) String s[ ]:
-
-
The Java compiler requires that a source file use the ________ filename extension
A) .hB) . javaC) >javaD) .class
-
-
Can an anonymous class be declared as implementing an interface and extending aclass
An anonymous class may implement an interface or extend a superclass, but may not bedeclared to do both.
-
-
Is null a keyword
The null value is not a keyword.
-
What is the difference between an if statement and a switch statement
The if statement is used to select among two alternatives. It uses a boolean expression todecide which alternative should be executed. The switch statement is used to select among multiple alternatives. It uses an int expression to determine which alternativeshould be executed.
-
What are the two types of multitasking?1. Process-based2. Thread-based
A) 1B) 2C) Both 1,2D) None of the above
-
-
-
What is the output of the following program?
class Test{
public static void main(String [] args){
int a=8;
a=--a+a--+a++;
System.out.println(a );
}} -
What are the functions of the dot(.) operator? (Select multiple)
A) It enables you to access instance variables of any objects within a classB) It enables you to store values in instance variables of an objectC) It is used to call object methodsD) It is to create a new object
-
Print Only Numbers From Java Strings
I have a question in Java-string,
String s="adf5hgjyu1frdsff6vgyu7bnjh9asd3"; like
How to print only numbers in that string
Java Interview Questions
Ans