Java Test-4 | Objective Questions | Interview questions | java basic coding

preview_player
Показать описание
Java Test-4 | Objective Questions | Interview questions | java basic coding

Java is one of the most popular and widely used programming languages and platforms. A platform is an environment that helps to develop and run programs written in any programming language. Java is fast, reliable, and secure. From desktop to web applications, scientific supercomputers to gaming consoles, cell phones to the Internet, Java is used in every nook and corner.

Java is one of the most popular programming languages in the world, known for its versatility, portability, and wide range of applications. Java is the most used language in top companies such as Uber, Airbnb, Google, Netflix, Instagram, Spotify, Amazon, and many more because of its features and performance.

In this article, we will provide 200+ Core Java Interview Questions tailored for both freshers and experienced professionals with 3, 5, and 8 years of experience. Here, we cover everything, including core Java concepts, Object-Oriented Programming (OOP), multithreading, exception handling, design patterns, Java Collections, and more, that will surely help you to crack Java interviews.
Simple: Java is quite simple to understand and the syntax
Platform Independent: Java is platform independent means we can run the same program in any software and hardware and will get the same result.
Interpreted: Java is interpreted as well as a compiler-based language.
Robust: features like Garbage collection, exception handling, etc that make the language robust.
Object-Oriented: Java is an object-oriented language that supports the concepts of class, objects, four pillars of OOPS, etc.
Secured: As we can directly share an application with the user without sharing the actual program makes Java a secure language.
High Performance: faster than other traditional interpreted programming languages.
Dynamic: supports dynamic loading of classes and interfaces.
Distributed: feature of Java makes us able to access files by calling the methods from any machine connected.
Multithreaded: deal with multiple tasks at once by defining multiple threads
Architecture Neutral: it is not dependent on the architecture.

👉 java Interview question.
👉 java program solution.
👉 java full course
👉 java full course in hindi
👉 java tutorial for beginner
👉 java programming
👉 learn java
👉 java tutorial
👉 tutorial in hindi
👉 java class in hindi
👉 java for beginners.
👉 learn java.
👉 java by op sir
👉 coding by op sir
👉 op sir
👉 placements
👉 placements course
👉 it placements
👉 job orianted course
👉 crack interview
👉 interview question and solution

java, learn java, java tutorial, java course, java programming, java tutorial for beginners, java for beginners, how to code java, java full course, how to code in java, java basics, java beginner lesson, java 13, learn java code, how to learn java, learn java quick, java gui, gui java, why java, java oop, oop java, learn to code java, learn java coding, learn java easy way, code java, core java, java 2024, java swing, curso java, learn java programming



#java #oops #class #object #array #loop #programming
#c #html #programming #css #coding #java #python #developer #programmer #webdeveloper #webdevelopment #code #coder #php #webdesign #software #softwaredeveloper #computerscience #codinglife #reactjs #technology #frontend #development #programmers #js #web #softwareengineer #programmingmemes #linux #javadeveloper


Some Others Playlists:

C language Full Course Playlist:

C Programs Playlist for Exercise:

DSA Using C Language for Beginners Step by Step in Hindi

Complete Java Course Playlist:

Java Programs Playlist in Hindi:

DSA Using Java (Data Structures and Algorithms) From Scratch for Beginners:

Javascript Full Playlist in Hindi:

Node Js Full Playlist in Hindi:

React Js tutorial for beginners in Hindi:
Рекомендации по теме
Комментарии
Автор

Yuvraj Singh Chouhan
1. A, B, C
2. A, B
3.F
4.A, B
5. s3, s4, s1, s2
6. Line 3, (as b is not present in parent class )
7. A
8. they may have covarient return types
9.A, D
10 A

YuviRajput
Автор

1. A, B, C
2. A, B
3. E, F
4. B
5. S3, S4, S1, S2
6. Line 3
7. A
9. A, D
10. A
13. D
14. C
15. B, C, E
16. B, D

venkatram.
Автор

{
int a=10;static int b=20;
// static int b=20;

Test(){

}

{

System.out.println("non static");
}
static{


System.out.println("static");
System.out.println(b);
System.out.println(b);

}

vineet
Автор

3---->>>>
class Parent{
public void m1()
{
System.out.println("m1");
}
void m2()
{
System.out.println("m2");
}


}

class Child extends Parent
{
public void m1()
{
System.out.println("m3");
}
void m2()
{
System.out.println("m4");
}

}
class Sample
{
public static void main(String[] args)
{
Parent p = new Child();
Parent p1 = new Parent();
p.m1();
p.m2();
p1.m1();
p1.m2();

}
}

tanishasharma
Автор

class p{

int a =10;
public void m1(){
System.out.println("p m1");
}
}
class c extends p
{
int b=20;
public void m2()
{
System.out.println("c m2");
}
}
class Test{
public static void main(String[] args)
{
c ob =new c();

System.out.println(ob.a);
//ob.m2();
ob.m1();
System.out.print(ob.b);
}
}

vineet
Автор

class Check{
int a =10;

Check(){

}

{
System.out.println("non static block");
}

static{
System.out.println("static block");
Check.m1();

}
static int b=20;

public void m(){
System.out.println("non static method");
}

public static void m1(){
System.out.println("static method");
System.out.println(b);
}

public static void main(String[] args) {
System.out.println("main method");
System.out.println(" main is "+b);
}
}

NamrataYadav-be
Автор

Q11
class A
{
int salary;
A(int salary)
{
this.salary=salary;
}
}
class Test
{
public static void main(String[] args)
{
A a1=new A(5000);

A a2=new A(15000);

A a3=new A(12000);


}
}

madhavvyas
Автор

Q8
class Try
{ int a;
Try()
{
a=10;
}
Try(Try t1)
{
a=t1.a+10;
}

public static void main(String[] args)
{
Try t1=new Try();
System.out.println(t1.a);
Try t2=new Try(t1);
System.out.println(t2.a);
System.out.println(t1.a);
}


}

madhavvyas
Автор

Q3

class Test {
int a = 10;
static int b = 20;

Test() {
System.out.println("it is a constructor");
}

// Non-static block
{
System.out.println("it is a non-static block");
}

// Static block
static {
System.out.println("it is a static block");
}

public void m() {
System.out.println("it is a non-static method block m");
}

public static void m2() {
System.out.println("it is a static method block m2");
}

public static void main(String[] args) {
System.out.println("it is a main method");

// Creating an object
Test obj = new Test();
obj.m(); // Calling non-static method
m2(); // Calling static method
}
}

madhavvyas
Автор

1---->>>>
abstract class RBI{
abstract public void fun(); //Abstract Method....

final public void m() //using Final Keywords....
{
String a="ForAtm"; // Normal Method....
System.out.println(a);
}
}


class Sbi extends RBI
{
public void fun()
{
System.out.println("SBI ATM");
}

}

class Cbi extends RBI
{
public void fun()
{
System.out.println("CBI ATM");
}
}

class Test {

public static void main(String[] args)
{

Sbi t=new Sbi();
Cbi c=new Cbi();
t.fun();
t.m();
c.fun();
c.m();
}
}

tanishasharma
Автор

Q4
class P{
int a=100;
public void m2(){
System.out.println("P m2()");
}
}
class C extends P{
int b=200;
public void m2(){
System.out.println("C m2()");
}
public void m3(){
System.out.println("C m3()");
}
}
class P3{
public static void main(String[] args) {
C ob = new C();

ob.m2();
ob.m3();
}
}

madhavvyas
Автор

// Vehicle ABSTRACT CLASS
abstract class Vehicle{
public void startEngine(){
System.out.println("start Engine");
}
abstract void move();
}
class Bike extends Vehicle{
public void move(){
System.out.println("bike moves on 2 wheelas");
}
}
class Truck extends Vehicle{

public void move(){
System.out.println("truck moves on 6 wheels");
}
}
class Car extends Vehicle{
public void move(){
System.out.println("car moves on 4 wheels");
}
public static void main(String[] args) {
Bike b = new Bike();
b.startEngine();
b.move();

Car c= new Car();
c.startEngine();
c.move();

Truck t = new Truck();
t.startEngine();
t.move();
}
}

rohitporwal
Автор

class Test{
int a=10;
static int b=20;
Test(){
System.out.println("Test Constructor");
}
{
block");
}
static {
System.out.println("static block");
System.out.println(b);
}
public void m()
{
System.out.println("non static method m");
}
public static void m1()
{
System.out.println("static mathod m1");
}
public static void main(String[] args)
{
System.out.println("main");
Test t = new Test();
}
}

Luckykag
Автор

//Q4
class Test
{
int a=10;
static int b=20;
Test()
{
System.out.println("it is a constructore");
}
{
System.out.println("it is nonstatic block");
}
static
{
System.out.println("it is static block");
}
public void m()
{
System.out.println("it is non static method block m");
}
public static void m2()
{
System.out.println("it is static method block m2");
}
public static void main(String[] args)
{
System.out.println("it is a main method");
Test obj = new Test();
}
}

dishipawar
Автор

1.A, B, c
2.A.B
3.E, F
4.B
5.s4, s3, s1, s3
6.line 3
7.A
8.d
9.A.d
10.A
11.B
13.d
14.c
15, b, c, d
16.bd

neetukhande
Автор

Q10
abstract class Demo{
abstract public void fun();
abstract public void m();{

}
}

class Test extends Demo{
public void fun()
{
System.out.println("fun () called");
}
public void m()
{
System.out.println("m() callled");
}

public static void main(String[] args) {
Demo d=new Test();
d.fun();
d.m();
}
}

madhavvyas
Автор

//Q5
class Test{
int a=10;
static int b=20;
Test()
{
System.out.println("test constructore");
}
{
System.out.println("non static block");
}
static
{
System.out.println("static block");
}
public void m()
{
System.out.println("non static method m");
}
public static void m1()
{
System.out.println("it is a static method");
}
public static void main(String[] args) {
System.out.println("main mathod");
Test t = new Test();
t.m();
Test.m1();
}

}

dishipawar
Автор

// Q.2
class Test{
int a=10;
static int b=20;
Test(){
System.out.println("Test constructor");
}
{
System.out.println("non static block");
}
static{
System.out.println("Static block");
}
public void m(){
System.out.println("non static method m");
}
public static void m1(){
System.out.println("static method m1");
}
public static void main(String[] args) {

Test t = new Test();

}
}

bhartigurjar
Автор

//12
class A
{
int salary;
A(int salary)
{
this.salary=salary;
}


}
class Test
{
public static void main(String[] args)
{
A a1=new A(5000);

A a2=new A(15000);

A a3=new A(12000);


}
}

dishipawar
Автор

Q5
class Test{
int a;
Test(){
a=10;
}
Test(Test t){
a=t.a;
}
public static void main(String[] args) {
Test ob=new Test();
System.out.println(ob.a);
Test ob1=new Test(ob);
System.out.println(ob1.a);
}
}

madhavvyas
welcome to shbcf.ru