JSharp 2003 Test
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<...
A Student class extends Person class: 1��������class Person 2��������{ 3�������� ��������int heightcm; 4 5����������������Person() 6����������������{��������this.heightcm=160; ��������} 7�������� 8...
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,...
Consider the following class: public class Intro { static int a; int b; public Intro() { int c; c = a; a++; b += c; ...
Consider the following classes: class Model { public int modelNo; Model(int modelNum) { modelNo=modelNum; } public int getModel() { return modelNo; } ...
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...
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() { ...
How is applet loading speed increased with J# 1.1?
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...
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 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(); ...
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...
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...
Visual J# runs on .Net framework.
What is wrong with the following method? public void manageCalc() { try { compute(); } finally { release(); } catch (MyException e) {} } }
What will be returned by the length()method of File class?
What will be the output of the following program? public class Prnt { public static void main(String args[]) { System.out.println(11 ^ 2); } }
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...
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 { ...
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...
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...
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#?
Which of the following Classes contains a method to create a directory?
Which of the following classes does not generate action events?
Which of the following helps you get a double value from a String object named "StrValue?"
Which of the following is correct with regard to Net J#?
Which of the following is incorrect with regard to Exceptions?
Which of the following is not a correct way of getting 'sin' value?
Which of the following methods will cause a thread to stop?
Which of the following statements is correct with regard to Final and Abstract?
Which of the following statements is correct with regard to J#?
Which of the following statements is incorrect with regard to data types?
Which of the following statements is incorrect with regard to interfaces?
Which of the following statements is incorrect with regard to Java Code?
Which of the following visibility modes is not defined in J#?
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...
You created the 'Msg' class as follows: class Msg { Msg() { String str1 = "Health"; String str2 = "is"; String str3 = "Wealth"; System.out.p...
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...
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?
You have created the following class to print some numbers: public class PrintNumber { int a; int b; public void basefunt() { a = 0; b =...
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...
You have defined an Integer as follows: int IntPageId = 5; What would you write for changing it into a String data type?
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 ...
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...
You have written a java class file named "CustomerManager.java." Which of the following commands helps you compile it on .Net Command prompt?
You need to create a class that associates a set of keys with a set of values. Which of these interfaces is most appropriate?
You want a component to resize vertically, but not horizontally. How should it be placed?