Practical 1

Advertisements
Advertisements
Advertisements3
Advertisements4
Advertisements6
Advertisements66

 1.Choose the correct answer

What is the output of the following Java program?

public class Main {

public static void main(String[] args) {

int x = 5;

int y = 10;

System.out.println(x + y);

}

}

Ans. 15.

2. What is the correct way to declare a variable in Java?

Ans.  int x=5;

3.  What is the output of the following Java program?

public class Main {

public static void main(String[] args) {

String message = “Hello, World!”;

System.out.println(message);

}

}

Ans. Hello, World!

 

 

Author: Lakshmi Prasanna Ponnala

Completed M.Tech in Digital Electronics and Communication Systems.

Leave a Reply

error: Content is protected !!

Discover more from ece4uplp

Subscribe now to keep reading and get access to the full archive.

Continue reading