OOPS and Core Java Interview Question and Answers

25. What is a Layout Manager?
 
  • Layout manager is responsible for positioning and sizing components within a container.
  • The containers, such as panel, scrollpane, window, frame, are special components that can contain other components.
 
Your Name Your Email-ID
Your Answer
26. What are the different types of Layout Managers in JDK?
  Types of Layout Managers are as follows:
  • BorderLayout
  • GridLayout
  • FlowLayout
  • GridBagLayout
  • CardLayout
  • NullLayout or CustomLayout
 
Your Name Your Email-ID
Your Answer
27. What is the difference between Static and Non Static fields of a class?
 
  • Non static values are also called as instance variables. Each object of the class has its own copy of Non Static instance variables.
  • So, when a new object is created of the same class it will have completely its own copy of instance variables.
  • While Static values have only one copy of instance variables and will be shared among all the objects of the class.
 
Your Name Your Email-ID
Your Answer
28. What is a Bytecode?
 
  • Bytecode is a highly optimized set of instructions designed to be executed by the Java runtime system, which is called the Java virtual Machine (JVM).
  • When the source code is compiled, the Java compiler creates machine code called bytecode for a hypothetical machine called Java Virtual Machine.
  • The JVM is supposed to execute the bytecode.
  • This bytecode is then run through an interpreter on the actual hardware, which converts this bytecode into machine code, required for that particular hardware, and executes it.
 
Your Name Your Email-ID
Your Answer
12345678910 Page 7 of 10