core java online Test

public static void main(String arg...){

.......

}

arg in main function shows.


class mp{

mp(){

System.out.println("hi");

}

mp(float x){

System.out.println("hello");

}}

class sp{

public static void main(String ard[]){

mp obj=new mp(12.89);

}}

what will be the output?


class mp{

mp(){

mp obj=new mp();

System.out.println("india");

}

void fun(){

System.out.println("great");

}}

class sp{

public static void main(String arg[]){

new mp().fun();

}}


class mp{

int x;

void fun(){

x=20;

}}

class sp{

public static void main(String arg[]){

System.out.println(mp.x);

}}


class mp{

int x=50;

mp(){

x=100;

}

void fun(){

x=200;

}}

class sp{

public static void main(String arg...){

int y=mp.x;

int x=new mp();

int z=new mp().fun();

System.out.println("y="+y+"x="+x+"z="+z+);

}}
























































Description:

questions are related to the basic concepts of java

Comments
Reshmi S
By: Reshmi S
987 days 12 hours 47 minutes ago

Can you please give answers with explanation?

Want to learn?

Sign up and browse through relevant courses.

or fill this simple form
Name:
Your Email:
Password:
Country:
Contact no.:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as shown in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
2 Followers
Test: 1

Your Facebook Friends on WizIQ

Connect