Core Java interview questions in thread programming

Thread: A thread is a section of code executed independently with in a program. Multithreading is an execution of the multitasking paradigm, where instead multiple program, multithreading involves multiple thread within a single program. A main() method in the java program creates the main thread. When a java application begins, the java virtual machine creates a java thread referred to as the main thread for you program. The different types of creating thread in a java program is, Implementing Runnable Interface, extending Thread class. Create…

Continue reading »

Common programming questions asked in core java interview

Factorial Example: //CodeParent Presents Factorial Example public class FactCode { public static void main(String[] args) { int i, factout = 1; int factcode = 5; // The number to be calculated for factorial for (i = 1; i <= factcode; i++) { factout = factout * i; } System.out.println("Code Parent Presents Factorial Code !!!"); System.out.println("Factorial of " + factcode + " is: " + factout); } } Output: Code Parent Presents Factorial Code !!! Factorial of 5 is: 120 Fibonacci Example: //CodeParent presents Fibonacci Code…

Continue reading »

Core Java interview questions for engineering fresher

Define Package: A package is collection of related classes and interfaces, which provides access protection and namespace management. What is the super class for all Classes? In which package it is present? A super class for all classes ini java is the object class. It is located in java.lang.package. Important Classes in java.io.package: 1. Input stream classes 2. Output stream classes 3. File classes 4. StreamTokenizer class Important class present in java.awt package: 1. Graphical classes 2. Layout manager classes 3. Font classes 4. Dimension…

Continue reading »