• Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • English APP
  • login
  • Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • Walkins
    • Corporate Job Exam
    • Government Job Exam
    • Entrance Exam
  • Training
    • Internship
  • Placement Questions
  • /
  • Java

Frequently Asked Java interview questions and answers for freshers Page 2

Java Select Another Category Select Another Topic

Programming and Technical

  • Android 118
  • ASP.NET 60
  • C 459
  • C++ 448
  • DATA STRUCTURE 66
  • DBMS 77
  • ELECTRONICS 39
  • Java 261
  • OOPs Concepts 117
  • Operating Syst 103
  • RDBMS 109
  • UNIX 70

Java Question Topics

    Category (1)

    General Ability (3)

  • General Knowledge (3)
  • HR Interview (3)

  • Interview (3)
  • Logical Reasoning (5)

  • Blood Relations (1)
  • Coding Decoding (2)
  • Cryptography (1)
  • Seating Arrangement (1)
  • Numerical Ability (4)

  • Algebra (1)
  • Number System (1)
  • Profit and Loss (1)
  • Programming (124)

  • Arrays (7)
  • Basics (5)
  • Database (4)
  • Definition (25)
  • Functions (3)
  • Output (4)
  • Program (20)
  • Puzzles (1)
  • Technical (43)
  • Verbal Ability (1)

  • Miscellaneous (1)
Keep an EYE (0)
Solved Question (3) UnSolved Question (258)
Pages: 27FirstPrev123456789NextLast
Advertisements

(#M40167129) JAVA QUESTION try, catch and finally Keep an EYE Keep an eye puzzle Keep an eye puzzle

Which of the following statement(s) are not true?

A. For each try block there can be zero or more catch blocks but only one finally block
B. Finally block will get executed whether or not an exception occurs.
C. A try block must be followed only by at least one catch block
D. A try block has multiple catch block, then those exception handlers can be in any order

Asked In Java Jax (3 years ago)
Unsolved Read Solution (2)
Is this Puzzle helpful?   (0)   (0) Submit Your Solution Technical

(#M40167137) JAVA QUESTION Java polymorphism Keep an EYE Keep an eye puzzle Keep an eye puzzle

class Mammal
{
String name= "Dog";
String makeNoise()
{
return "Bow Wow";
}
}

class Cat extends Mammal
{
String name="Cat";
String makeNoise()
{
return "Meow";
}
}

public class Main
{
void go()
{
Mammal m = new Cat();
System.out.println(m.name + m.makeNoise());
}
public static void main (String[] args)
{
new Main().go();
}
}

What is the output of the above program?

A. CatMeow
B. DogBow Wow
C. DogMeow
D. CatBow Wow

Asked In Java Jax (3 years ago)
Unsolved Read Solution (2)
Is this Puzzle helpful?   (8)   (3) Submit Your Solution Output
Advertisements

(#M40018857) JAVA QUESTION JAVA QUESTIONS Keep an EYE Keep an eye puzzle Keep an eye puzzle

public void test(int x)
{
int odd = 1;
if(odd) /* Line 4 */
{
System.out.println("odd");
}
else
{
System.out.println("even");
}
}

Which statement is true?

A. Compilation fails.
B. "odd" will always be output.
C. "even" will always be output.
D. "odd" will be output for odd values of x, and "even" for even values.

Asked In Java (12 years ago)
Unsolved Read Solution (22)
Is this Puzzle helpful?   (82)   (28) Submit Your Solution Program

(#M40167128) JAVA QUESTION Exceptions Keep an EYE Keep an eye puzzle Keep an eye puzzle

Exception is an abnormal event or error that occurs during ________

A. Runtime
B. Compile time
C. any time - unpredictable
D. Any of these options

Asked In Java Jax (3 years ago)
Unsolved Read Solution (3)
Is this Puzzle helpful?   (0)   (2) Submit Your Solution Arrays

(#M40167120) JAVA QUESTION Matcher class Keep an EYE Keep an eye puzzle Keep an eye puzzle

Consider the below statements.

Statement 1 : Matcher class interprets the pattern in a String

Statement 2 : Matcher class matches the regular expression against the text provided

Which of the following is true?

A. Statement 2 alone is correct.
B. Both Statement 1 and 2 are incorrect.
C. Statement 1 alone is correct.
D. Both Statement 1 and 2 are correct

Asked In Java Jax (3 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (2)   (1) Submit Your Solution Functions

(#M40167107) JAVA QUESTION Is Java is a structured programming language? Keep an EYE Keep an eye puzzle Keep an eye puzzle

State true or false. Java is a structured programming language.

A. True

B. False

Asked In Java Jax (3 years ago)
Unsolved Read Solution (2)
Is this Puzzle helpful?   (7)   (3) Submit Your Solution Basics

(#M40031855) JAVA QUESTION Keep an EYE Keep an eye puzzle Keep an eye puzzle

What is the output of this program?

class area {
public static void main(String args[])
{
double r, pi, a;
r = 9.8;
p1 = 3.14;
a = pi * r * r;
System.out.println(a);
}
}
a) 301.5656
b) 301
c) 301.56
d) 301.56560000

Asked In Java Rajendra Singh (11 years ago)
Unsolved Read Solution (41)
Is this Puzzle helpful?   (64)   (23) Submit Your Solution Program

(#M40167111) JAVA QUESTION Default method in java Keep an EYE Keep an eye puzzle Keep an eye puzzle

A default method in an interface can be either private or public or protected. State True or False.

Asked In Java Jax (3 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (5)   (3) Submit Your Solution Functions

(#M40167135) JAVA QUESTION Exceptions 3 Keep an EYE Keep an eye puzzle Keep an eye puzzle

Predict the output

import java.io.IOException;

public class Exception1{

public static void main(String[] args)

{

try

{

throw new IOException();

}

catch(IOException | Exception ex)

{

System.out.println(ex + " handled ");

}

}

}

A. program won't compile
B. runtime exception
C. program will compile
D. None of the above

Asked In Java Jax (3 years ago)
Unsolved Read Solution (2)
Is this Puzzle helpful?   (2)   (6) Submit Your Solution Program

(#M40167116) JAVA QUESTION Java Polymorphism question Keep an EYE Keep an eye puzzle Keep an eye puzzle

What is the output of the following program?

class Icecream
{
public void displayName(String s)
{
System.out.println(s+" "+"Icecream");
}
public void describe(String s)
{
System.out.println(s+" "+"Icecream: Ice cream is a sweetened frozen food typically eaten as a snack or dessert. ");
}
}

class Faloodeh extends Icecream
{
public void displayName(String s)
{
System.out.println(s+" "+"Faloodeh ");
}

public void describe(String s)
{
System.out.println(s+" "+"Faloodeh: Faloodeh is often served alongside Persian-style dairy-based ice cream ");
}
}

public class Test
{
public static void main(String arg[])
{
Icecream a = new Faloodeh();
Faloodeh b = (Faloodeh)a;
a.displayName("test");
b.displayName("test");
a.describe("test");
b.describe("test");
}
}

A. test Faloodeh: Faloodeh is often served alongside Persian-style dairy-based ice cream
test Faloodeh: Faloodeh is often served alongside Persian-style dairy-based ice cream
test Faloodeh
test Faloodeh

B. test Faloodeh
test Faloodeh
test Faloodeh: Faloodeh is often served alongside Persian-style dairy-based ice cream
test Faloodeh: Faloodeh is often served alongside Persian-style dairy-based ice cream

C. test Faloodeh
test Faloodeh: Faloodeh is often served alongside Persian-style dairy-based ice cream
test Faloodeh: Faloodeh is often served alongside Persian-style dairy-based ice cream
test Faloodeh

D. test Faloodeh: Faloodeh is often served alongside Persian-style dairy-based ice cream
test Faloodeh
test Faloodeh
test Faloodeh: Faloodeh is often served alongside Persian-style dairy-based ice cream

Asked In Java Jax (3 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (6)   (5) Submit Your Solution Output
Keep an EYE (0)
Solved Question (3) UnSolved Question (258)
Pages: 27FirstPrev123456789NextLast
  • Login
  • Register

Resend

Sponsored Links

Advertisements

Challenger of the Day

no image
Dimple
India
Punjab
Time: 00:01:33
Points
19

Maths Quotes

The essence of mathematics resides in its freedom.

Georg Cantor

If u consizder ur self as zero. ...... Don't worry u r d whole mathematics. ..

pkg

Placed User Comments

M4Math helped me a lot.

Vipul Chavan 5 years ago

Thanks m4 maths for helping to get placed in several companies.
I must recommend this website for placement preparations.

yash mittal 5 years ago

Now enjoy Offline Access of latest Question.

Get M4maths app to avail expert's solution and latest selected questions.

Download m4maths app now

  • 2533K+Registerd user
  • 1774K+Engineers
  • 759K+MBA Asprirant
  • 3K+Enginnering College
  • 250+Company Exam
  • 150K+Interview Questions
  • Site Links
  • Home
  • Result
  • Today's Puzzle
  • Discussion Board
  • Maths Tricks
  • Advertise with us
  • Contact Us
  • Useful Info
  • Maths Quotes
  • Previous Puzzles
  • Prize
  • Privacy Policy
  • Disclaimer and Copyright
  • Terms and Conditions
  • Sitemap
  • Placement papers
  • TCS Placement Paper
  • HCL Placement Paper
  • INFOSYS Placement Paper
  • IBM Placement Paper
  • SYNTEL Placement Paper
  • TECHNICAL Interview
  • HR Interview
All rights are reserved to @m4maths.com