Answer:
Option c is the correct answer for the above question.
Explanation:
- The super is a keyword in java which is used to call the parent class constructor from the child class constructor, but the only one thing is important to write the super is the constructor that the super keyword needs to be written as a first-line where it is used.
- The above question has three option which holds the constructor, in which option 1 and 2 holds the super keyword as the last line. So this option is not to hold the correct constructor.
- But option 3 will hold the Super as the first line, Hence this is the correct use of the constructor.
- And Only option c states about option 3 while the other is states about the other option. Hence option c is the correct answer.
Answer:
import java.util.Scanner;
public class HelloIDE
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter your name: ");
String name = input.nextLine();
name = name.trim();
if(name.equals(""))
name = "stranger";
System.out.println("Hello, " + name + "!");
}
}
Explanation:
import the Scanner class to be able to get input from the user
Create an object of the Scanner class called input
Ask the user to enter the name and set it to the name
Trim the name using trim() method, removes the whitespaces from the string
Check the name. If name is equal to "", set the name as stranger. This way if the name is empty, or just contains whitespaces or if name is not given, name will be set as stranger.
Print the name in required format
Answer:
User Datagram Protocol (UDP) , transport-layer segment.
Explanation:
The User Datagram Protocol is popularly known as UDP. It is defined as the communication protocol which is used across the internet for any time sensitive transmission like the DNS lookup or the video playback.
The UDP provides a unreliable and connectionless service to a invoking application.
The transport layers on sending side converts the application
messages which it
from the
into a transport layer segment called as the transport layer segments. This is achieved by breaking down the application messages into a smaller chunks and then adding the transport layer header into each chunk so as to create a transport layer segment.
Answer:
PLCs (Programmable logic controller) were original designed as replacement for relay control panels. Relay is another word for a switch. Relay control panels were made for the control of electronic instrumentents or devices. Later on PLCs were made to replace these timers and relay control panels. PLCs are more reliable, flexible and can work better in the harsh environmental situations then the relay control panels.