Simple Java interview question

preview_player
Показать описание
Java programming interview questions
Java tutorial
Java programming
Java interview questions
learn Java
#scjp #javaprogramming #javainterviewquestion #javatutorial #interview #learnjava #javaquestions #javascript
Рекомендации по теме
Комментарии
Автор

No output

Bcoz Test() is a default constructor and this default constructor is not present in the program

And here class name and method name is same, so we have to not get confused between them.

But if void is removed, then we will get the output as LikeThisVideo

singamhariharan
Автор

No Output. No return type for constructor.

nagaraj.s
Автор

To use a non-static method, we need to create an object of the class that the method belongs to. so without creating an object we cant access the method, , , Hence no output....

Prashantbaurai
Автор

be referenced from a static content : without using static raise an error

vinothkumarbalaji
Автор

No output because to we have not created an object only we have called to method.

PushpendraVlog
Автор

No output..bcz there is no object by calling

ramanayyadharmana
Автор

Isn’t it a constructor? Why wouldn’t it be called when you have written new Test() already?

bhaktipatil
Автор

When you remove void you get output from constructor

manasanayak
Автор

No output.
because this is an instance of Test class and the Test method is not called

NumairaNawaz
Автор

CTE... Because its not interface its a class so we must use acess specifier..

dineshnadar
Автор

It is a function which is not called so no output

rajputrider
Автор

No output...In case of void test we use the static keyword then we will get the output

mondipdas