» » Top 25 Java Basic Interview Questions for Freshers

Imp Note: Openings for 2016 and 2017 pass outs (MNC) in india. Send your profile to Instanceofjava@gmail.com subject should be: yourName_fresher_resume

1.What is the most Important feature of java?

  • Java is platform independent language.

2.What do you mean by Platform Independence?

  • Platform Independence  you can run and compile program in one platform and can execute in any other platform.



3.What is JVM(Java Virtual Machine)?
  • JVM is Java Virtual Machine which is a run time Environment for the compiled java class.

4.What is JIT Compiler?

  • Just-In-Time(JIT) compiler is  used to improve the performance. JIT compiles parts of the byte code that have similar functionality at the same time,

5.Are JVM's Platform Independent?

  •  JVM'S are not platform Independent. JVM'S are platform Specific.

6.What if main method declare as private?

  • No,It will compile fine but in run time it will error like main method should be in public.cannot find main method.

7.What is platform?

  • A platform is basically the hardware or software environment in which a program runs.
  • There are two types of platforms software and hardware.
  • Java provides software-based platform.

8.What all memory areas are allocated by JVM?

  • Heap, Stack, Program Counter Register and Native Method Stack

9.What is the base class of all classes?

  • java.lang.Object

10.What is javac ?

  • It produces the java byte code from *.java file.
  • It is the intermediate representation of your source code that contains instructions.

11.Can we mark constructors final?

  • No, Constructor cannot be declared final.

12.What are two different ways to call garbage collector?

  • System.gc() OR Runtime.getRuntime().gc().

13.Can we override a static method?

  • No, we cannot override a static method. Static means class level.

14.Use of finalize() method in java?

  •  finalize() method is used to free the allocated resource.

15.Is it possible to overload main() method of a class?

  • Yes, we can overload main() method as well. 
  • But every time public static main(String[] args) will be called automatically by JVM.
  • Other methods need to call explicitly.

16. Does Java support operator overloading?

  • Operator overloading is not supported in Java.

17.Can I declare a data type inside loop in java?

  • Any Data type declaration should not be inside the loop. Its possible but not recommended.


18.List two java ID Es?

  • 1.Eclipse, 2.Net beans and 3.IntelliJ

19.Can we inherit the constructors?

  • No, we cannot inherit constructors. 
  • We can call super class constructors from subclass constructor by using super() call.

20.Can this keyword be assigned null value?
  • No, this keyword cannot have null values assigned to it.
21.Basic java interview programs for freshers 
22.Java Quiz for freshers

23. Top 25 java interview Questions for freshers  

24.Top 15 oops concepts interview questions and answers

25. Top 40 Java interview Programs asked in interview for freshers

You Might Like:



Java programming interview questions
  1. Print prime numbers? 
  2. What happens if we place return statement in try catch blocks 
  3. Write a java program to convert binary to decimal 
  4. Java Program to convert Decimal to Binary
  5. Java program to restrict a class from creating not more than three objects
  6. Java basic interview programs on this keyword 
  7. Interfaces allows constructors? 
  8. Can we create static constructor in java 
  9. simple java interview questions on Super keyword
  10. Java interview questions on final keyword
  11. Can we create private constructor in java
  12. Java Program Find Second highest number in an integer array 
  13. Java interview programming questions on interfaces 
  14. Top 15 abstract class interview questions  
  15. Java interview Questions on main() method  
  16. Top 20 collection framework interview Questions
  17. Java Interview Program to find smallest and second smallest number in an array 
  18. Java Coding Interview programming Questions : Java Test on HashMap  
  19. Explain java data types with example programs 
  20. Constructor chaining in java with example programs 
  21. Swap two numbers without using third variable in java 
  22. Find sum of digits in java 
  23. How to create immutable class in java 
  24. AtomicInteger in java 
  25. Check Even or Odd without using modulus and division  
  26. String Reverse Without using String API 
  27. Find Biggest substring in between specified character
  28. Check string is palindrome or not?
  29. Reverse a number in java?
  30. Fibonacci series with Recursive?
  31. Fibonacci series without using Recursive?
  32. Sort the String using string API?
  33. Sort the String without using String API?
  34. what is the difference between method overloading and method overriding?
  35. How to find largest element in an array with index and value ?
  36. Sort integer array using bubble sort in java?
  37. Object Cloning in java example?
  38. Method Overriding in java?
  39. Program for create Singleton class?
  40. Print numbers in pyramid shape?
  41. Check armstrong number or not?
  42. Producer Consumer Problem?
  43. Remove duplicate elements from an array
  44. Convert Byte Array to String
  45. Print 1 to 10 without using loops
  46. Add 2 Matrices
  47. Multiply 2 Matrices
  48. How to Add elements to hash map and Display
  49. Sort ArrayList in descending order
  50. Sort Object Using Comparator
  51. Count Number of Occurrences of character in a String
  52. Can we Overload static methods in java
  53. Can we Override static methods in java 
  54. Can we call super class static methods from sub class 
  55. Explain return type in java 
  56. Can we call Sub class methods using super class object? 
  57. Can we Override private methods ? 
  58. Basic Programming Questions to Practice : Test your Skill
  59. Java programming interview questions on collections

Instance Of Java

We will help you in learning.Please leave your comments and suggestions in comment section. if you any doubts please use search box provided right side. Search there for answers thank you.
«
Next
Newer Post
»
Previous
Older Post

4 comments for Top 25 Java Basic Interview Questions for Freshers

  1. its really helpful we are grateful to u sir..

    ReplyDelete
  2. thank you sir,
    very usefull information...

    ReplyDelete
  3. Hi i will share frequently asked questions in java,
    what is parsing?
    Parsing is a process of converting one data type to another in java convert string to int
    For example String to integer.

    ReplyDelete

Select Menu