java lang and java io Mcqs
Our collections of Multiple choice questions and answers focuses on study of java lang and java io. These questions are chosen from a collection of most authoritative and best reference books on Java. Our aim is to prepare an individual for competitive exams like NTS, GAT, ECAT, University and College entrance exams and various tests and job interviews. One should practice our Mcqs to assimilate java lang and java io topic comprehensively.
Java Programming Mcqs
- Data Types Variables and Arrays Mcqs
- Exception Handling in Java Mcqs
- Interfaces and Packages Mcqs
- Java Classes and Methods Mcqs
- Java Event Handling Mcqs
- Java Inheritance Mcqs
- Java IO and Applets Mcqs
- java lang and java io Mcqs
- Java Language Fundamentals Mcqs
- Java Operators and Control Statements Mcqs
- java utilities Mcqs
- Miscellaneous Topics in Java Mcqs
- Multithreading in Java Mcqs
- Serialization and Networking Mcqs
- Session Management and JSP and Servlet Mcqs
- String Handling
Computer MCQS
Sciences MCQS
2.
Which of the following methods is a method of wrapper Integer for obtaining hash code for the invoking object?
Int hash()
Int hashcode()
Int hashCode()
Integer hashcode()
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
3.
Which of these is a super class of wrappers Long, Character & Integer?
Long
Digits
Float
Number
4.
Which of these is a wrapper for simple data type char?
Float
Character
String
Integer
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
5.
Which of the following is method of wrapper Integer for converting the value of an object into int?
Bytevalue()
Int intValue();
Bytevalue()
Byte Bytevalue()
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
6.
Which of these methods is used to obtain value of invoking object as a long?
Long value()
Long longValue()
Long longvalue()
Long Longvalue()
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
7.
What is the output of this program?
class Output
{
public static void main(String args[])
{
char a[] = {'a', '5', 'A', ' '};
System.out.print(Character.isDigit(a[0]) + " ");
System.out.print(Character.isWhitespace(a[3]) + " ");
System.out.print(Character.isUpperCase(a[2]));
}
}
class Output
{
public static void main(String args[])
{
char a[] = {'a', '5', 'A', ' '};
System.out.print(Character.isDigit(a[0]) + " ");
System.out.print(Character.isWhitespace(a[3]) + " ");
System.out.print(Character.isUpperCase(a[2]));
}
}
True false true
False true true
True true false
False false false
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
8.
What is the output of this program?
class Output
{
public static void main(String args[])
{
Integer i = new Integer(257);
byte x = i.byteValue();
System.out.print(x);
}
}
class Output
{
public static void main(String args[])
{
Integer i = new Integer(257);
byte x = i.byteValue();
System.out.print(x);
}
}
0
1
256
257
10.
Which of the following method of Process class can terminate a process?
Void kill()
Void destroy()
Void terminate()
Void exit()
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
12.
Which of these class can encapsulate an entire executing program?
Void
Process
Runtime
System
13.
Which of the following is method of System class is used to find how long a program takes to execute?
Currenttime()
CurrentTime()
CurrentTimeMillis()
CurrenttimeMillis()
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
14.
Which of these class holds a collection of static methods and variables?
Void
Process
Runtime
System
15.
What is the output of this program?
class Output
{
public static void main(String args[])
{
long start, end;
start = System.currentTimeMillis();
for (int i = 0; i < 10000000; i++);
end = System.currentTimeMillis();
System.out.print(end - start);
}
}
class Output
{
public static void main(String args[])
{
long start, end;
start = System.currentTimeMillis();
for (int i = 0; i < 10000000; i++);
end = System.currentTimeMillis();
System.out.print(end - start);
}
}
0
1
1000
System Dependent
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
16.
What is the output of this program?
class Output
{
public static void main(String args[])
{
byte a[] = { 65, 66, 67, 68, 69, 70 };
byte b[] = { 71, 72, 73, 74, 75, 76 };
System.arraycopy(a , 0, b, 0, a.length);
System.out.print(new String(a) + " " + new String(b));
}
}
class Output
{
public static void main(String args[])
{
byte a[] = { 65, 66, 67, 68, 69, 70 };
byte b[] = { 71, 72, 73, 74, 75, 76 };
System.arraycopy(a , 0, b, 0, a.length);
System.out.print(new String(a) + " " + new String(b));
}
}
ABCDEF ABCDEF
ABCDEF GHIJKL
GHIJKL ABCDEF
GHIJKL GHIJKL
Answer & Solution
No Solution for this Answer..! Report or Discus this Question
17.
Which of these class is a superclass of all other classes?
Math
Process
System
Object