Correct Answer : James Gosling
Correct Answer : 1991
Correct Answer : JRE
Correct Answer : String
Correct Answer : A Java Applet
Correct Answer : A segment of code to be run a specified amount of times
Correct Answer : All of the above.
Correct Answer : Integer
Correct Answer : byte
Correct Answer : New
Correct Answer : Graphical User Interface
Correct Answer : Abstract window Toolkit
Correct Answer : java.util.EventObject
Correct Answer : public static void main(String args[])
Correct Answer : Private
Correct Answer : Anything
Correct Answer : void returns no data type.
Correct Answer : Both of the above
Correct Answer : int[] []x[];
String[] array = {"1","2","4","5"}; int i = array.length; for(String x : array)i++; System.out.println(i);
Correct Answer : 8
Correct Answer : Ar.length - 1
Correct Answer : An abstract definition of an object
Correct Answer : 4
Correct Answer : 64 bit
String s1 = "a"; String s2 = s1; s1 += "b"; System.out.println(s2);​
Correct Answer : a
Correct Answer : All of the above
Correct Answer : Perform the same operation on all elements in array
Correct Answer : Arrays.sort()
Correct Answer : Thread(Runnable a, String str)
Correct Answer : Run()
Correct Answer : An operator and keyword
Correct Answer : JFrame
Correct Answer : It can take any number of parameters
Correct Answer : Polymorphism is the ability of an object to take on many forms.
Correct Answer : Instance variables are variables within a class but outside any method.
Correct Answer : boolean b3 = false;
Correct Answer : Any class or interface
Correct Answer : Object Class
Correct Answer : Public superclass member (and protected subclass members if it's in the same package)
Correct Answer : Applets are run over the web.
Correct Answer : Create an instance of a class (an object)
Correct Answer : The method setSize()
Correct Answer : Java.Lang.throwable
Correct Answer : PATH
double value = 2 / 3; System.out.println(value);
Correct Answer : 0.0
Correct Answer : Writing an algorithm before writing your program and having a test plan
Correct Answer : A Java program that is run through a web browser
Correct Answer : Multiple methods in same class, same name and return type, different parameters
Correct Answer : To keep track of data in the memory of the computer
Correct Answer : java.time (JSR-310)
int i = 255; byte b = (byte) i; System.out.println(b);
Correct Answer : -1
Correct Answer : java.sql.Date
class average { public static void main(String args[]) { double num[] = {5.5, 10.1, 11, 12.8, 56.9, 2.5}; double result; result = 0; for (int i = 0; i < 6; ++i) result = result + num[i]; System.out.print(result/6); } }​
Correct Answer : 16.46666666666667
class Bitwise { public static void main(String [] args) { int x = 11 & 9; int y = x ^ 3; System.out.println( y | 12 ); } }​
Correct Answer : 14
Correct Answer : sub-class
int a = -1; a = a >> 1; System.out.println(a);​
public class operatorExample { public static void main(String args[]) { int x=4; System.out.println(x++); } } ​
Correct Answer : output=4
Correct Answer : this()
byte b = (byte) 128; b >>>= 1; System.out.println(b);​
Correct Answer : -64
int a = 1; a += ++a * a; System.out.println(a);​
Correct Answer : 5
public final class Main { static final String s = "hello"; public void main(String[] args) { System.out.println(s); } }
Correct Answer : The code will fail at run time
Correct Answer : Abstract classes can define methods but Interfaces can only delcare methods -(D)
String x = "John Doe"; System.out.println("'"+x.substring(5)+"'");
Correct Answer : 'Doe'
String a = "Hello"; String b = " Hello "; System.out.println(a.equals(b));
Correct Answer : false
Correct Answer : int myList [] = {4, 3, 7};
Correct Answer : native
Correct Answer : interface
Correct Answer : public double methoda();
Correct Answer : -32768 to 32767
1. int w = (int)888.8; 2. byte x = (byte)100L; 3. long y = (byte)100; 4. byte z = (byte)100L;
Correct Answer : All statements are correct
Correct Answer : 3.4e+038
Correct Answer : double
class increment { public static void main(String args[]) { int g = 3; System.out.print(++g * 8); } }
Correct Answer : 32
Correct Answer : Ascending order
Correct Answer : Sorted in the order of declaration of Enums
enum Levels { private TOP, public MEDIUM, protected BOTTOM; }
Correct Answer : Compilation Error
Correct Answer :
Correct Answer : Precision
Correct Answer : toString uses scientific notation
Correct Answer : static variable with value 1 on scale 0
Correct Answer : Integer or Boolean
Correct Answer : keyword
class array_output { public static void main(String args[]) { int array_variable [] = new int[10]; for (int i = 0; i < 10; ++i) { array_variable[i] = i/2; array_variable[i]++; System.out.print(array_variable[i] + " "); i++; } } }
Correct Answer : 1 2 3 4 5
class dynamic_initialization { public static void main(String args[]) { double a, b; a = 3.0; b = 4.0; double c = Math.sqrt(a * a + b * b); System.out.println(c); } }
Correct Answer : 5.0
Correct Answer : The destination type is larger than source type
public class prototype { }​
Correct Answer : public prototype( )
Correct Answer : Floating-point value assigned to an integer type
class conversion { public static void main(String args[]) { double a = 295.04; int b = 300; byte c = (byte) a; byte d = (byte) b; System.out.println(c + " " + d); } }
Correct Answer : 39 44
class main_arguments { public static void main(String [] args) { String [][] argument = new String[2][2]; int x; argument[0] = args; x = argument[0].length; for (int y = 0; y < x; y++) System.out.print(" " + argument[0][y]); } }
Correct Answer : 1 2 3
class c { public void main( String[] args ) { System.out.println( "Hello" + args[0] ); } }
Correct Answer : Runtime Error
int a[], b; int []c, d;
Correct Answer : ‘b’ is int variable; ‘d’ is int array
int arr[] = new int [5]; System.out.print(arr);
Correct Answer : Garbage value
Object[] names = new String[3]; names[0] = new Integer(0);
Correct Answer : ArrayStoreException
Correct Answer : System.arrayCopy()
Correct Answer : Sequential
Correct Answer : Both Integers and floating – point numbers
1. x++; 2. x = x + 1; 3. x += 1; 4. x =+ 1;
Correct Answer : 1, 2, 3 & 4
class increment { public static void main(String args[]) { double var1 = 1 + 5; double var2 = var1 / 4; int var3 = 1 + 5; int var4 = var3 / 4; System.out.print(var2 + " " + var4); } }
Correct Answer : 1.5 1
class Modulus { public static void main(String args[]) { double a = 25.64; int b = 25; a = a % 10; b = b % 10; System.out.println(a + " " + b); } }
Correct Answer : 5.640000000000001 5
&
&=
|=
<=
Correct Answer : <=
Correct Answer : The right shift operator automatically fills the higher order bits with 0
class bitwise_operator { public static void main(String args[]) { int a = 3; int b = 6; int c = a | b; int d = a & b; System.out.println(c + " " + d); } }
Correct Answer : 7 2
class Output { public static void main(String args[]) { int a = 1; int b = 2; int c = 3; a |= 4; b >>= 1; c <<= 1; a ^= c; System.out.println(a + " " + b + " " + c); } }
Correct Answer : 3 1 6
Correct Answer : Boolean
class Relational_operator { public static void main(String args[]) { int var1 = 5; int var2 = 6; System.out.print(var1 > var2); } }
Correct Answer : False
class bool_operator { public static void main(String args[]) { boolean a = true; boolean b = !true; boolean c = a | b; boolean d = a & b; boolean e = d ? b : c; System.out.println(d + " " + e); } }
Correct Answer : false true
class Output { public static void main(String args[]) { int x , y = 1; x = 10; if (x != 10 && x / 0 == 0) System.out.println(y); else System.out.println(++y); } }
Correct Answer : 2
expression1 ? expression2 : expression3
int x, y, z; x = 0; y = 1; x = y = z = 8;
class operators { public static void main(String args[]) { int x = 8; System.out.println(++x * 3 + " " + x); } }
Correct Answer : 27 9
Correct Answer : switch
Correct Answer : continue
class comma_operator { public static void main(String args[]) { int sum = 0; for (int i = 0, j = 0; i < 5 & j < 5; ++i, j = i + 1) sum += i; System.out.println(sum); } }
Correct Answer : 6
class Output { public static void main(String args[]) { final int a=10,b=20; while(a<b) { System.out.println("Hello"); } System.out.println("World"); } }
Correct Answer : compile time error
Correct Answer : Break halts the execution and forces the control out of the loop
switch(a) { System.out.println("Hello World"); }
Correct Answer : byte and char
Correct Answer : From innermost loops or switches
Correct Answer : Compilation
Correct Answer : Compile time polymorphism
Correct Answer : Abstraction
Correct Answer : Aggregation
Correct Answer : JDK
Correct Answer : .class
Correct Answer : Java source file header
Correct Answer : They read high level code and execute them
box obj;
Correct Answer : NULL
Correct Answer : Box obj = new Box();
class main_class { public static void main(String args[]) { int x = 9; if (x == 9) { int x = 8; System.out.println(x); } } }
Correct Answer : Compilation error
Correct Answer : this
Correct Answer : finalize()
class box { int width; int height; int length; int volume; box() { width = 5; height = 5; length = 6; } void volume() { volume = width*height*length; } } class constructor_output { public static void main(String args[]) { box obj = new box(); obj.volume(); System.out.println(obj.volume); } }
Correct Answer : 150
Correct Answer : Class.getInstance creates object if class does not have any constructor
Correct Answer : Passing itself to method of the same class
Correct Answer : method overloading
Correct Answer : Recursion
class test { int a; int b; void meth(int i , int j) { i *= 2; j /= 2; } } class Output { public static void main(String args[]) { test obj = new test(); int a = 10; int b = 20; obj.meth(a , b); System.out.println(a + " " + b); } }
Correct Answer : 10 20
Correct Answer : static
Correct Answer : Encapsulation
class static_out { static int x; static int y; void add(int a, int b) { x = a + b; y = x + b; } } public class static_use { public static void main(String args[]) { static_out obj1 = new static_out(); static_out obj2 = new static_out(); int a = 2; obj1.add(a, a + 1); obj2.add(5, a); System.out.println(obj1.x + " " + obj2.y); } }
Correct Answer : 7 9
Correct Answer : equals()
class string_class { public static void main(String args[]) { String obj = "I LIKE JAVA"; System.out.println(obj.charAt(3)); } }
Correct Answer : I
class string_class { public static void main(String args[]) { String obj = "I LIKE JAVA"; System.out.println(obj.length()); } }
Correct Answer : 11
Correct Answer : main()
public static void main(String args[])
Correct Answer : args is an array of String
class Output { public static void main(String args[]) { System.out.print("args[0]"); } }
Correct Answer : This
class Output { public static void main(String args[]) { System.out.print("args[3]"); } }
Correct Answer : command
class Output { public static void main(String args[]) { System.out.print("args"); } }
Correct Answer : This is a command Line
class Output { public static void main(String args[]) { System.out.print("(int)args[2] * 2"); } }
Correct Answer : 20
class Output { public static void main(String args[]) { System.out.print("args[6]"); } }​
Correct Answer : N
Correct Answer : Recursion is a process of defining a method that calls other methods repeatedly
Correct Answer : An infinite loop occurs
Correct Answer : java.lang
class recursion { int func (int n) { int result; if (n == 1) return 1; result = func (n - 1); return result; } } class Output { public static void main(String args[]) { recursion obj = new recursion() ; System.out.print(obj.func(5)); } }
Correct Answer : 1
Correct Answer : Method overriding
public interface Status { /* insert qualifier here */ int MY_VALUE = 10; }
Correct Answer : final, static, public
class Abc { public static void main(String[]args) { String[] elements = { "for", "tea", "too" }; String first = (elements.length > 0) ? elements[0]: null; } }
Correct Answer : The variable first is set to elements[0]
Correct Answer : abstract
class A { public int i; protected int j; } class B extends A { int j; void display() { super.j = 3; System.out.println(i + " " + j); } } class Output { public static void main(String args[]) { B obj = new B(); obj.i=1; obj.j=2; obj.display(); } }
Correct Answer : 1 2
Correct Answer : private member
Correct Answer : class B extends A {}
class A { int i; void display() { System.out.println(i); } } class B extends A { int j; void display() { System.out.println(j); } } class inheritance_demo { public static void main(String args[]) { B obj = new B(); obj.i=1; obj.j=2; obj.display(); } }
Correct Answer : int hashCode()
Correct Answer : long longValue()
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])); } }
Correct Answer : false true true
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[]) { Long i = new Long(256); System.out.print(i.hashCode()); } }
Correct Answer : 257
Correct Answer : void destroy()
Correct Answer : currentTimeMillis()
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); } }
Correct Answer : System Dependent
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)); } }
Correct Answer : ABCDEF ABCDEF
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, 1, b, 3, 0); System.out.print(new String(a) + " " + new String(b)); } }
Correct Answer : ABCDEF GHIJKL
Correct Answer : Object
Correct Answer : approximately 2.72
double d = Math.round ( 2.5 + Math.random() );
Correct Answer : 3
class Output { public static void main(String args[]) { int x = 3.14; int y = (int) Math.abs(x); System.out.print(y); } }
class Output { public static void main(String args[]) { double x = 3.1; double y = 4.5; double z = Math.max( x, y ); System.out.print(z); } }
Correct Answer : 4.5
class Output { public static void main(String args[]) { double x = 2.0; double y = 3.0; double z = Math.pow( x, y ); System.out.print(z); } }
Correct Answer : 8.0
Correct Answer : gc()
Correct Answer : load()
import java.lang.System; class Output { public static void main(String args[]) { System.exit(5); } }
Correct Answer : doubleValue()
class Output { public static void main(String args[]) { Double i = new Double(257.5); boolean x = i.isNaN(); System.out.print(x); } }
class Output { public static void main(String args[]) { Double i = new Double(257.578123456789); float x = i.floatValue(); System.out.print(x); } }
Correct Answer : 257.57812
import java.io.*; class files { public static void main(String args[]) { File obj = new File("/java/system"); System.out.print(obj.getName()); } }
Correct Answer : system
Correct Answer : print() and write()
import java.io.*; class filesinputoutput { public static void main(String args[]) { InputStream obj = new FileInputStream("inputoutput.java"); System.out.print(obj.available()); } }
Correct Answer : prints number of bytes in file
Correct Answer : Character Stream
Correct Answer : CharArrayReader
Correct Answer : Metaspace
Correct Answer : Java Heap
Correct Answer : IllegalArgumentException
class exception_handling { public static void main(String args[]) { try { int a[] = {1, 2,3 , 4, 5}; for (int i = 0; i < 7; ++i) System.out.print(a[i]); } catch(ArrayIndexOutOfBoundsException e) { System.out.print("0"); } } }
Correct Answer : 123450
Correct Answer : double ceil(double X)
class Output { public static void main(String args[]) { double x = 3.14; int y = (int) Math.abs(x); System.out.print(y); } }
class Output { public static void main(String args[]) { double x = 3.14; int y = (int) Math.ceil(x); System.out.print(y); } }
class Output { public static void main(String args[]) { Double i = new Double(257.5); Double x = i.MAX_VALUE; System.out.print(x); } }
Correct Answer : 1.7976931348623157E308
class Output { public static void main(String args[]) { Double i = new Double(257.5); Double x = i.MIN_VALUE; System.out.print(x); } }
Correct Answer : 4.9E-324
Correct Answer : charValue()
class Output { public static void main(String args[]) { int a = Character.MAX_VALUE; System.out.print((char)a); } }
?
$
<
>
Correct Answer : ?
class Output { public static void main(String args[]) { int a = Character.MIN_VALUE; System.out.print((char)a); } }
@
!
Correct Answer : Space
class Output { public static void main(String args[]) { char a = (char) 98; a = Character.toUpperCase(a); System.out.print(a); } }
Correct Answer : B
Correct Answer : booleanValue()
Correct Answer : toString()
class Output { public static void main(String args[]) { String str = "true false true"; boolean x = Boolean.valueOf(str); System.out.print(x); } }
Correct Answer : IEEEremainder()
Correct Answer : double ciel(double X)
class Output { public static void main(String args[]) { double x = 3.14; int y = (int) Math.toDegrees(x); System.out.print(y); } }
Correct Answer : 179
class Output { public static void main(String args[]) { double x = 102; double y = 5; double z = Math.IEEEremainder(x, y); System.out.print(z);} } }
Correct Answer : SecurityException
Correct Answer : TotalMemory()
Correct Answer : findSystemClass()
class X { int a; double b; } class Y extends X { int c; } class Output { public static void main(String args[]) { X a = new X(); Y b = new Y(); Class obj; obj = b.getClass(); System.out.print(obj.getSuperclass()); } }
Correct Answer : class X
Correct Answer : Runnable interface
Correct Answer : sleep()
class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"My Thread"); t.start(); } public void run() { System.out.println(t); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }
Correct Answer : Thread[My Thread,5,main]
Correct Answer : Serialization
Correct Answer : writeObject()
Correct Answer : void close()
Correct Answer : TCP/IP
Correct Answer : 1024
Correct Answer : InetAddress
Correct Answer : LogMessage
Correct Answer : parse()
import java.net.*; class networking { public static void main(String[] args) throws MalformedURLException { URL obj = new URL("https://www.freetimelearning.com/java"); System.out.print(obj.toExternalForm()); } }
Correct Answer : https://www.freetimelearning.com/java
Correct Answer : toExternalForm()
import java.net.*; class networking { public static void main(String[] args) throws MalformedURLException { URL obj = new URL("https://www.freetimelearning.com/java"); System.out.print(obj.getProtocol()); } }
Correct Answer : http
Correct Answer : getLastModified()
Correct Answer : getSocketAddress()
Correct Answer : throw
class exception_handling { public static void main(String args[]) { try { System.out.print("Hello" + " " + 1 / 0); } catch(ArithmeticException e) { System.out.print("World"); } } }
Correct Answer : World
class exception_handling { public static void main(String args[]) { try { int i, sum; sum = 10; for (i = -1; i < 3 ;++i) sum = (sum / i); } catch(ArithmeticException e) { System.out.print("0"); } System.out.print(sum); } }
Correct Answer : finally & catch
Correct Answer : ArithmeticException