Java programming basic and advance interview question answer. Java coding example. Banking, Financial, Computer related and Software related abbreviation. Computer storage devices. PC to PC files transfer using WiFi. Introduction to Network Topology. Difference Between Hub Switch and Router. Difference Between Wired and Wireless Network. Advantages and Disadvantages of Computer Network. Networking Interview Questions for Experienced. Basic Networking Interview Questions.

Monday, October 1, 2018

300+ Core Java Interview Question

Core Java Interview Question


Page No:-3

101.Which of the following is the root class of all AWT?

a. java.awt.event.Event             
b. java.awt.AWTEvent   
c. java.awt.event.AWTEvent
d. java.awt.ActionEvent 

102.The wrapper classes belongs in which package?

a. java.util 
b. java.awt

103.Full form of DGC?

a. Digital Garbage Collection
b. Distributed Garbage Collection 
c. Distribution Garbage Connection
d. None of this

104.Which class cannot be instantiated in java?

a. Abstract Class   
b. Static Class
c. Final class
d. None of the above

105.Iterator traverses elements works in ____ direction only?

a. forward.  
b. backward.

106.Which of the following package is used for analyzing code during run time?

a. java.lang.reflect   
b. java.awt
d. java.applet

107.Which of the following are not wrapper classes?

a. Byte.
b. Integer.
c. Random.   
d. Double.

108.Which method is used to perform the cleanup processing?

a. static()method  
b. finalize() method
c. gc() method   
d. None of the above 

109.What is an iterator ?

a. Iterator is an interface.   
b. Iterator is a class.  
c. Iterator is a method
d. None of the above

110.garbage collection simple means?

a. Reference object
b. UN-Reference object    

111.In JDBC Prepared Statement object is used to execute_______queries.

a. High level
b. Simple
c. Executable
d. Parameterized   

112.How to convert Date object to String?

a. SimpleDateFormat java = new SimpleDateFormat(“yyyy-mm-   dd”);

   java.parse(new Date());

b. SimpleDateFormat java = new SimpleDateFormat(“yyyy-mm-dd”);   

   java.format(new Date());

c.SimpleDateFormat java = new SimpleDateFormat(“yyyy-mm-dd”);

   new Date().java();

d. None of the above

113.Which of the following package provides core functionality in java?


b. java.rmi

c. java.lang   
d. java.math

114.Which of the following is returned by operator '&' ?

a. Short
b. Character  
c. Integer
d. Float

115.Bellow which methods are not a Thread class methods?

A. yield()
B. sleep()
C. go()    
D. stop()

116.Which is a non-static method having the same name as the class name?

a. Constructor   
b. Method
c. Field  
d. None of the above

117.Hibernate is an?

a. Server  
b. Framework   
c. Language
d. All mentioned above

118.Set contain only?

a. unique elements   
b. duplicate elements

119.Can we declare abstract methods as synchronized?

a. yes
b. No 

120.Which of the following statement is true for method overloading?

a. If two or more methods have same name, but different argument then it is called method overloading.  
b. If two or more methods have same name,with same argument then it is called method overloading.
c. If two or more methods have different name, but same argument then it is called method overloading.
d. none of Above.

121.finalize( ) method can be overloaded?

a. Yes  
b. No

122.Which of the following inheritance is enable by interface?

a. multilevel
b. multiple  
c. low level
d. None of the above

123.When A variable declared inside the body of the method is called?

a. Static variable

b. Instance variable

c. Local variable   

d. None of the above

124.In java top of exception class hierarchy is?

a. Object  

b. ArithmeticException 
c. Throwable    
d. Exception

125.Which method is more secured Get or Post.

a. GET
b. Post   

126.In java String is a ?

d.None of Above

127.Which is the cause of thread to die?

a.  Execution of the start( ) method ends 
b. The method wait( )
c. Execution of the run( ) method ends  
d. The method sleep( )

128.Which of the following data type values is returned by all transcendental math functions?

a. double   
b. float
c. int 
d. Short

129.Which of the following server is the example of Application Server?

a. Apache Tomcat
b. JBoss     
d. None of the above

130.Which of the following keyword is reserved but used in the initial version of Java are?

a. goto 
b. inner
c. const 
d. union   

131.What will be the answer of the following code?
           int a=6,b=4        
           System.out.println(a++ + ++b);
a. 8
b. 6
c. 12
d. 11   

132.How can you change user thread to daemon thread?

a. By setDaemon(true)   

b. By setDaemon(false)

c. By threads()

d. None of Above

133.Which is the correct order declarations in a Java ?

a. Package declaration -> import statement -> class declaration.  

b. Import statement -> package declaration -> class declaration.

c. Import statement -> class declaration -> package declaration.

d. None of above.

134.Overloading means in java?

a.  The same method name with different types of parameters in different class. 
b. The same method name with different types of parameters in one class.    
c. None of above.

135.A protected member can be accessible from.

a. A subclass of the same package 
b. A non-subclass of the same package
c. A non-subclass of different package 
d. The same class.

136.overriding is not possible if we declare class as a?

a. static 
b. const 
c. final 
d. abstract 

137.Can two threads execute static and non static methods 

a. Yes   
b. No

138.Which answer is correct of the following code?

          int c=4;
          System.out.println (c++);
a. 2 
b. 4 
c. 5 
d. 8 

139.Which answer is correct of the following code?

          int c=4;
          System.out.println (c);
a. 2 
b. 4 
c. 5    
d. 8 

140.In java wrapping up the hole data and functions into a single unit is called?

a. Encapsulation   
b. Abstraction
c. Data Hiding 
d. Polymorphism

141.Functions are stored in which of the following java package?

a. java.lang   
c. java.awt.
d. java.util 

142.Generally string is a sequence of characters, But in java, string is an _______.

a. Package
b. Class
c. Object   
d. None of the above

143.Which of the following statements is true?

a. The extends keyword is used for inheritance from one class to another class      
b. The extends keyword is used for inheritance from one inheritance to another interface
c. The implements keyword is used to specify that a class inherits from another class
d. None of the above.

144.In java break, continue, return, try-catch-finally belongs in which satement?

a. Selection statements
b. Loop Statements
c. Transfer statements   
d. Pause Statement

145.Can interfaces become local members of the methods?

a. Yes
b. No  

146.What will happen if we not initialize variables in an interface.

a. Run-time error 
b. Compile-time error   
c. Program will be run
d. None of the above

147.What is an iterator ?

a. Iterator is an interface which belongs java.util package.   
b. Iterator is a class which belongs java.util package
c. Iterator is an interface which belongs java.lang package
d. Iterator is an interface which belongs java.awt package 

148.Which of the following is not a threads method?


149.Below which method returns the host name of the IP Address In InetAddress class ? 

a. public static InetAddress getLocalHost() 
b. public String hostAddress()
c. public String getHostName()   
d. None of the above

150.Which of the following is not a subclass of 'writer' stream.

a. FileReader
b. LineWriter    
c. PrintWriter
d. BufferedWriter 

[ Ans:-  101.b   102.d   103.b   104.a   105.a   106.a   107.c   108.c   109.a   110.b   111.d   112.b   113.c   114.b   115.c   116.a   117.b   118.a   119.b   120.a   121.a   122.b   123.c   124.c   125.b   126.a   127.c   128.a   129.b   130.d   131.d   132.a   133.a   134.b   135.c   136.c   137.a   138.b   139.c   140.a   141.a   142.c   143.a   144.c   145.b   146.b   147.a   148.b   149.c   150.b  ]  




No comments:

Post a Comment