A class named MyLoop is defined as follows: public class MyLoop { public static void main(String args[]) { int counter = 0; lbl1: for (int i=10; i<...
The program will fail to compile 0%
The program will compile and produce no output 0%
The program will print 0 as output 0%
The program will print 10 as output 0%
A Student class extends Person class: 1��������class Person 2��������{ 3�������� ��������int heightcm; 4 5����������������Person() 6����������������{��������this.heightcm=160; ��������} 7�������� 8...
The Program will compile and run successfully. 0%
The Program will not compile due to an error in line 23 0%
The Program will not compile due to an error in line 24 0%
The Program will not compile due to an error in line 25 0%
Consider the following class: import java.util.*; public class Coll { public static void main(String str[]) { List l = new ArrayList(); l.add("1"); l.add("2"); l.add(1,...
[1, 3, 2, 1, 1, 2] 0%
[1, 3, 1, 1, 3, 2] 0%
[1, 1, 2, 1, 3, 2] 0%
[1, 3, 2, 1, 3, 2] 0%
Consider the following class: public class Intro { static int a; int b; public Intro() { int c; c = a; a++; b += c; ...
The code will fail to compile because there are two constructors with the same names and parameters 0%
The code will fail to compile because the constructor is trying to access a static variable 0%
The code will compile but gives a runtime error 0%
The code will compile and runs successfully 0%
Consider the following classes: class Model { public int modelNo; Model(int modelNum) { modelNo=modelNum; } public int getModel() { return modelNo; } ...
The code will compile and run successfully 0%
The code will not compile as the constructor Item (int modelNo) is missing in the Item class 0%
The code will not compile as the call super (ModelNumber) is missing in Item() 0%
The code will compile but gives runtime error 0%
Consider the following program: import java.util.*; public class ListColl { public static void main(String str[]) { List l = new ArrayList(); l.add("1"); l.add("2"); l.a...
[1, 3, 2, 1, 1, 2] 0%
[1, 3, 1, 1, 3, 2] 0%
[1, 1, 2, 1, 3, 2] 0%
[1, 3, 2, 1, 3, 2] 0%
For a J# project in Visual Studio .Net, the files can be a mixture of .jsl or .java extensions.
Given below is the definition of two classes in "Maruti.java": public class Automobile { Automobile(int i) {} } class Maruti extends Automobile { public Maruti() { ...
The code will compile but throws an exception when it is run 0%
The code will compile and does not produce any output when it is run 0%
The code will fail to compile 0%
None of the above 0%
How is applet loading speed increased with J# 1.1?
By using a special algorithm to increase the download speed 0%
By using CAB files to download the applet 0%
By using ZIP files to reduce the size for download 0%
All of the above 0%
In the following code, val is an Integer variable: if( val > 4 ) { System.out.println( "Test A" ); }else if( val > 9 ) { System.out.println( "Test B" ); }else System.out.println( "Test C...
val < 4 0%
val between 4 and 9 0%
val > 9 0%
No values for val will result in "Test C" being printed 0%
The classes Zen and Matiz are as follows: class Zen { int x = 10; } class Matiz { Matiz() { Zen z1 = new Zen(); Zen z2 = new Zen(); update(z1); update(...
The code will fail to compile 0%
10 10 10 10 0%
20 20 20 20 0%
10 20 10 20 0%
The Tracer and Viewer classes are as follows: class Tracer { public static int traceNo = 10; } class Viewer { Viewer() { Tracer t1 = new Tracer(); Tracer t2 = new Tracer(); ...
The code will fail to compile 0%
11 12 0%
11 11 0%
12 12 0%
Two classes are defined as follows: class Category {} class Document extends Category {} class Legal extends Document {} You initialized the class Legal like this: Legal legl = new Legal(); What...
It calls Legal(),Document(), and Category() 0%
It calls Legal(),Category(), and Document() 0%
It calls Category(),Document(), and Legal() 0%
It calls Category(),Legal(), and Document() 0%
Two functions are defined with the same name in a class: public boolean isGreater(int no1, int no2) public boolean isGreater(String st1, String st2) Which of the following concept does this defin...
Abstraction 0%
Overloading 0%
Overriding 0%
Encapsulation 0%
Visual J# runs on .Net framework.
What is wrong with the following method? public void manageCalc() { try { compute(); } finally { release(); } catch (MyException e) {} } }
There is no error in the code 0%
The block 'finally' should come after the block 'catch' 0%
An empty catch block is not allowed 0%
None of the above 0%
What will be returned by the length()method of File class?
The number of characters in the file 0%
The number of bytes in the file 0%
The number of lines in the file 0%
None of the above 0%
What will be the output of the following program? public class Prnt { public static void main(String args[]) { System.out.println(11 ^ 2); } }
10 0%
9 0%
11 0%
13 0%
121 0%
What will be the output when myMethod() is executed? class MyPoint { void myMethod() { int x, y; x = 5; y = 3; System.out.print( " ( " + x + ", " + y + " ) " ); switchCo...
(5, 3) (5, 3) (5, 3) 0%
(5, 3) (3, 5) (3, 5) 0%
(5, 3) (3, 5) (5, 3) 0%
No output will be printed 0%
What will be the output when the following code is compiled and run? abstract class Search { public Search() { } public abstract void Result(); } public class SearchMain extends Search { ...
The code will fail to compile 0%
The code will compile but fails to run 0%
The code will compile and print "I am Result()" 0%
The code will compile but does not produce any output 0%
What will be the output when the following code is compiled and run? class Equates { Equates() { int a,b,c; a = b = c = 20; System.out.println(a); } public stat...
The code will fail to compile 0%
20 is printed 0%
Nothing is printed 0%
True is printed 0%
What will be the output when the following code is compiled and run? class Num { Num() { int k = 1; int i = ++k + k++ + + k; System.out.println(i); } public sta...
The code will fail to compile 0%
8 is printed 0%
9 is printed 0%
7 is printed 0%
What will be written to the standard output when the following program is run? public class Message { public static void main(String args[]) { String msg = "GoodDay"; System.ou...
Which of the following are supported by J#?
Windows Forms 0%
ASP.NET Web Forms and Mobile Web Forms 0%
XML Web services 0%
Cross-language integration 0%
All of the above 0%
Which of the following Classes contains a method to create a directory?
File 0%
DataOutput 0%
Directory 0%
FileDescriptor 0%
FileOutputStream 0%
Which of the following classes does not generate action events?
Choice 0%
MenuItem 0%
List 0%
Checkbox 0%
Which of the following helps you get a double value from a String object named "StrValue?"
(System.Double)(System.GetDouble(StrValue)) 0%
(System.Double)(System.ParseDouble(StrValue)) 0%
(System.Double)(System.Double.Parse(StrValue)) 0%
System.Double.Parse(StrValue) 0%
Which of the following is correct with regard to Net J#?
It supports sun java up to JDK 1.1.5 0%
It supports sun java up to JDK 1.1.4 0%
It supports sun java up to JDK 1.1.3 0%
It supports sun java enterprise edition and standard edition 0%
Which of the following is incorrect with regard to Exceptions?
Catching java.lang.Exception will catch any .NET exceptions 0%
Catching System.Exception will catch any .NET exceptions 0%
Catching java.lang.Exception will catch any java exceptions 0%
Catching System.Exception will catch any java exceptions 0%
Which of the following is not a correct way of getting 'sin' value?
Math m = null; double val = m.sin(25); 0%
double val = Math.sin(25); 0%
Math m = new Math(); double val = m.sin(25); 0%
Which of the following methods will cause a thread to stop?
Calling interrupt() method of the thread 0%
Calling sleep() method on thread 0%
Conclusion of execution of the run() method 0%
None of the above 0%
Which of the following statements is correct with regard to Final and Abstract?
An abstract class cannot have final methods 0%
An abstract class cannot have non abstract methods 0%
A final class cannot have abstract methods 0%
A final class cannot have final methods 0%
Which of the following statements is correct with regard to J#?
All the J# data types are derived from java.lang.Object 0%
The java.lang.Object is a superclass of System.Object 0%
The java.lang.Object is an alias for System.Object 0%
The ObjectImpl package provides functionality for all the methods belonging to java.lang.Object 0%
Which of the following statements is incorrect with regard to data types?
J# wraps primitive types to Objects behind the scene 0%
Primitive data types are defined as structures in the system namespace 0%
Internal handling of primitive data types in J# is exactly the same as in java 0%
Which of the following statements is incorrect with regard to interfaces?
A class can implement multiple interfaces 0%
An abstract class cannot extend multiple interfaces 0%
An interface can extend multiple interfaces 0%
Methods with same name, arguments, and sequence can exist in the interfaces implemented by a class 0%
Which of the following statements is incorrect with regard to Java Code?
The java code can be compiled in Netbean/Eclipse as well as in VisualStudio 0%
Netbean compiles java source to Java byte code whereas Visual Studio compiles it to MSIL 0%
Both Netbean and Visual Studio produce class files as a result of compilation 0%
All of the above 0%
Which of the following visibility modes is not defined in J#?
protected 0%
private 0%
package 0%
default 0%
You created a few classes (as mentioned below) for file manipulation: public class CopyFile { } class ReadFile { } class WriteFile { } Which of the following is a valid way t...
ReadFile.java 0%
WriteFile.java 0%
FileManupulation.java 0%
All of the above 0%
You created the 'Msg' class as follows: class Msg { Msg() { String str1 = "Health"; String str2 = "is"; String str3 = "Wealth"; System.out.p...
This code will fail to compile because arrayIndexOutOfBound exception is not caught 0%
It will print Healthis on the first line followed by HealthWealth on the second line 0%
It will print Healthis on the first line followed by HealthisWealth on the second line 0%
It will print Healthis on the first line followed by HealthisHealthWealth on the second line 0%
You have a simple java class named "Record": public class Record { protected void readRecord(int newId) throws Exception,IOException{} protected void insertRec(int recNo) throws FileNotFoundExcept...
protected void readRecord(int newId) throws IOException 0%
protected void insertRec(int recNo) throws Exception 0%
public void deleteRecord(int recordNo) throws EOFException 0%
public boolean isValidRecord(int recordNo) throws EOFException 0%
You have compiled a java class named "DirReader.java" using .Net command prompt. Which of the following commands helps you run it from the same window?
>java DirReader 0%
>java DirReader.java 0%
>vj DirReader 0%
>DirReader 0%
You have created the following class to print some numbers: public class PrintNumber { int a; int b; public void basefunt() { a = 0; b =...
000 0%
101 0%
001 0%
110 0%
100 0%
You have defined a static method to divide two integers: 1��������public static int divide(int a,int b) throws Exception 2��������{ 3����������������if(b==0) 4������������������������throw new Exc...
The method syntax is correct 0%
The general Exception cannot be specified with parameter (line 4) 0%
In the line 4, the word 'throw' should be replaced with 'throws' 0%
A static method can be throw not as throw Exceptions 0%
You have defined an Integer as follows: int IntPageId = 5; What would you write for changing it into a String data type?
String strPageId = System.Data.ToString(IntPageId); 0%
String strPageId = IntPageId.ToString(); 0%
String strPageId = System.Convert.ToString(IntPageId); 0%
String strPageId = IntPageId; 0%
You have defined the following methods in one of the java classes: 1 void setId(int newId) 2 private void manageRecord(int RecordNo) 3 protected void delete(int recordNo) 4 ...
public void setId(int newId) 0%
void manageRecord(int RecordNo) 0%
void delete(int recordNo) 0%
protected boolean isValidRecord(int recordNo) 0%
You have defined two classes (as mentioned below) in a java file named "CustomerClass.java" : class Customer { . . . } class OldCustomer { . . . } None of the classes defined above have any static...
This will give a compilation error saying 'one class must be declared public' 0%
This will give a compilation error saying 'two non-public classes cannot be declared in one java file' 0%
This will give a compilation error saying, 'No main method found' 0%
None of the above 0%
You have written a java class file named "CustomerManager.java." Which of the following commands helps you compile it on .Net Command prompt?
javax CustomerManager.java 0%
java CustomerManager.java 0%
jsharp CustomerManager.java 0%
vjc CustomerManager.java 0%
You need to create a class that associates a set of keys with a set of values. Which of these interfaces is most appropriate?
Collection 0%
Set 0%
Map 0%
SortedSet 0%
You want a component to resize vertically, but not horizontally. How should it be placed?
BorderLayout in the North or South location 0%
FlowLayout as the first component 0%
BorderLayout in the East or West location 0%
BorderLayout in the Center location 0%
GridLayout 0%