Careerschool - JAVA Pre-Screening Test
Minimum Score to Pass is 45
Email *
Full Name *
Name of the College *
Reg Number *
Department Name *
 Number of primitive data types in Java are? *
1 point
What is the size of float and double in java? *
1 point
Automatic type conversion is possible in which of the possible cases? *
1 point
Find the output of the following code.

int Integer = 24; char String = ‘I’; System.out.print(Integer); System.out.print(String);
*
1 point
Find the output of the following program.

public class Solution{ public static void main(String[] args){ short x = 10; x = x * 5; System.out.print(x); } }
*
1 point
 Which of the following is not a Java features? *
1 point
What is used to find and fix bugs in the Java programs.
*
1 point
Which of the following is a valid declaration of a char? *
1 point
What is the return type of the hashCode() method in the Object class? *
1 point
Which of the following is a valid long literal? *
1 point
What does the expression float a = 25 / 0 return? *
1 point
JDK Stands for? *
1 point
JRE Stands for? *
1 point
What makes the Java platform independent? *
1 point
What are the types of memory allocated in memory in java? *
1 point
Multiline comment is created using ___. *
1 point
Can we write a program without a main method in Java?
*
1 point
Which class in Java is used to take input from the user? *
1 point
Which of this interface must contain a unique element? *
1 point
Which of the following declarations does not compile? *
1 point
What is the output of following program?

public class Test { 

          public static void main(String[] args) {
                 for(int i = 0; i < 5; i++) { 
                       System.out.println(i + ' '); 
                               } 
                  }
}
*
1 point
Find the value of A[1] after execution of the following program.
int[] A = {0,2,4,1,3}; for(int i = 0; i < a.length; i++){ a[i] = a[(a[i] + 3) % a.length]; }
*
1 point
Identify the output of the following program.
String str = “abcde”; System.out.println(str.substring(1, 3));
*
1 point
Identify the output of the following program.
Public class Test{ Public static void main(String argos[]){ String str1 = “one”; String str2 = “two”; System.out.println(str1.concat(str2)); } }
*
1 point
How many objects will be created in the following?
String a = new String(“Interviewbit”); String b = new String(“Interviewbit”); Strinc c = “Interviewbit”; String d = “Interviewbit”;
*
1 point
Find the output of the following code.
int ++a = 100; System.out.println(++a);
*
1 point
Find the output of the following code.
Public class Solution{ Public static void main(String… argos){ Int x = 5; x * = (3 + 7); System.out.println(x);
*
1 point
Output of Math.floor(3.6)? *
1 point

Identify the correct way of declaring constructor.

Public class Solution {}

*
1 point
Find the output of the following code.
Public class Solution{ Public static void main(String args[]){ Int i; for(i = 1; i < 6; i++){ if(i > 3) continue; } System.out.println(i); } }
*
1 point

How many times will “Interviewbit” be printed.

Int count = 0; do{ System.out.println(“Interviewbit”); count++; } while(count < 10);
*
1 point
Identify the infinite loop. *
1 point
Which is the first line to trigger a compiler error?

double d1 = 5f; // p1 
double d2 = 5.0; // p2 
float f1 = 5f; // p3 
float f2 = 5.0; // p4
*
1 point
What is true of the finalize() method? *
1 point
Which of the following is true about primitives? *
1 point
What is the output of the following?

Integer integer = new Integer(4); System.out.print(integer.byteValue()); System.out.print("-"); int i = new Integer(4); System.out.print(i.byteValue());
*
1 point
How do you force garbage collection to occur at a certain point? *
1 point
Which of the following does not compile? *
1 point
What is the value of tip after executing the following code snippet?
int meal = 5; 
int tip = 2; 
int total = meal + (meal>6 ? ++tip : --tip);
*
1 point
What is the output of the following application?
String john = "john"; 
String jon = new String(john); System.out.println((john==jon) + " "+ (john.equals(jon)));
*
1 point
Which of these is a type of variable in Java? *
1 point
What is type casting in Java? *
1 point
Which of the following can be declared as final in java? *
1 point
The break statement in Java is used to ___. *
1 point
Can the Java program accept input from the command line? *
1 point
Object in java are ___. *
1 point
'this' keyword in java is ___. *
1 point
The 'super' keyword is used to ___. *
1 point
The super() method is used to ___. *
1 point
Boxing is ___. *
1 point
public class Main
{
public static int ret(){
    return 0;
}    
public static void main(String[] args) {
    int a = 0;
    if(ret()==0)
    System.out.print("Careerschool");
    System.out.println("HRSolutions");
}
}
*
1 point
public class Main
{
public static void main(String[] args) {
    int a = 0;
    if(a==1);{
        System.out.println("Careerschool");
    }
}
}
*
1 point
public class Main
{  
public static void main(String[] args) {
    String temp = "10.87";
    int a = Float.parseFloat(temp);
    System.out.println(a);
}
}
*
1 point
public class Main
{  
public static void main(String[] args) {
    float a = 10.0000f;
    String temp = Double.toString(a);
    System.out.println(temp);
}
}
*
1 point
public class Main
{  
public static void main(String[] args) {
        int a = 10.0;
        String temp = Integer.toString(a);
        System.out.println(temp);
    }
}
*
1 point
public class Main
{
    public static int sum(int a, int b){
       if(a+b>10)
       return 0;
       System.out.print(a+b);
       return a+b;
    }
   
    public static void main(String[] args) {
        System.out.println(sum(1, sum(0,1)));
    }
}
*
1 point
public class Main
{
    public static int sum(int a, int b){
        System.out.print(a+""+b);
        return a+b;
    }
   
    public static void main(String[] args) {
        System.out.println(sum(sum(1,2),3));        
    }
}
*
1 point
public class Main
{
    public static int sum(int a, int b){
       return a+b;
    }
   
    public static void main(String[] args) {
        System.out.println(sum(sum(1,2),3));
       
       
    }
}
*
1 point
public class Main
{
    public void sum(int a, int b){
        System.out.print(a+b);
    }
   
    public static void main(String[] args) {
        sum(0,0);
        sum(-1,-1);
       
    }
}
*
1 point
How many times 'Careerschool' is printed?

public class Main
{
public static void main(String[] args) {
    while(false){
        System.out.println("Careerschool");
    }
}
}
*
1 point
public class Main
{
private int a;
public Main(){
       
    }
public Main(int temp){
        a = -10;
    }

public static void main(String[] args) {
    Main obj = new Main();
    System.out.println(obj.a);
}
}
*
1 point
public class Main
{
public static void main(String[] args) {
   
     int arr[] = {'a','b','c','d','e'};
   
    System.out.print(arr);
}
}
*
1 point
public class Main
{
public static void main(String[] args) {
        int arr[] = {'a','b','c','d','e'};
       
    for(int i = 0 ; i<5; i++){
        System.out.print(" "+ (char)arr[i]);
    }
}
}
*
1 point
public class Main
{
public static void main(String[] args) {

        int arr[] = {'a','b','c','d','e'};
       
    for(int i = 0 ; i<5; i++){
            System.out.print(" " + arr[i]);
    }
    }
}
*
1 point
What is correct sequence of execution of any Java  program?
*
1 point
public class Cshr{

public static void main(String args[]) {
       
       int a =10;
       String b = "10+10";
     
       System.out.println(a+b);
     
    }
}
*
1 point
public class CSHR{

public static void main(String args[]) {
       
       int a =10;
       String b = "10";
     
       System.out.println(b+a);
     
    }
}
*
1 point
public class CppBuzz {

public static void main(String args[]) {
       
       int a =10;
       String b = "10";
     
       System.out.println(a+b);
     
    }
}
*
1 point
import java.util.Scanner;

public class CppBuzz{
 
public static void main(String[] args){
 
  String name;
 
  Scanner sc = new Scanner(System.in);
  System.out.println("Enter your name : ");
  name = sc.nextLine(); //assume if user enters 'cppbuzz'
 
  switch(name.length()){
   
    case 5:
    case 6:
    case 7:
    case 8:
    case 9:
    case 10: System.out.print("Length is  5-10"); break;
    default: System.out.print("Length not in 5-10");
   
  }
 
}
}
*
1 point
public class CppBuzz{
 
public static void main(String[] args){
 
  int a = 5;
  a +=5;
 
  switch(a){
   
    case 5: System.out.print("5");break;
    case 10: System.out.print("10");
             System.out.print(((a%2 ==0) ? "-even-" : "-odd-"));  
    default: System.out.print("0");
   
  }
 
}
}
*
1 point
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy