Skip to main content

ads1

Java Programming || Write a Java program to Print Hello World. || BCA Sem-4

 

JAVA Programming 


1. Write a Java program to Print Hello World.

 class helloworld

{

public static void main(String args[])

{

System.out.println("Hello World");

}

}

Output :- 


Explain  

To create a Java Program , 

First , We have to create a Class, and assign the Name for your java program.

Second , We have to write "public static void main(String args[])"  

Public :- Public is an Access modifier, If we use public access specifier. It will be easy access the method . If we make the main() method public makes it globally available.

Static :- Static is a keyword , Which is when associated with a method , it is a class related method. If we make main method Static ,JVM can invoke it without instantiating the class.

Void :- Void is a keyword, basically void means Nothing . It used to specify that a method doesn’t return anything.

Main :- It is a java main method. It’s not a keyword. It is basically a identifier that JVM look for as the starting point of the java program.

String[] args:- It stores Java command line arguments and is an array of type java.lang.String class.

Third, We have to type System.out.println("Hello World"), Which is a Java statement that prints the argument passed, into the Statement.




ads2

Popular posts from this blog

Class 10th Chapter 7 Functions in Calc

   Functions in Calc Calc provide built-in standard functions for mathematical, logical, statistical, date and time, financial and other calculations on numbers and text. The process of inserting a function is similar for all functions.That is, to use a function we need to enter a correct spelling of the function along with necessary arguments. This is known as syntax of the functions. t is possible to loose the grip on it and easy to introduce errors. To avoid this, you may take help of function wizard. The Calc support some more functions that support logical decision making. These functions are AND, OR, and NOT. (1) In which of the following ways we can enter a function in Calc ? (a) Directly typing function name in a cell nan (b) Function wizard or selecting from tool bar (c) A and B both (d) Depends on functions (2) A function can start with which of the following options ? (a) '='sign (b) Alphabets (c) Numbers (d) Any of these (3) Which of the following is not a logical...

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise or class wise.

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise  or class wise. Solution :-   # x-axis is shows the subject and y -axis # shows the markers in each subject # import pandas and matplotlib  import pandas as pd  import matplotlib.pyplot as plt # Simple Line Chart with setting of Label of X and Y axis, # title for chart line and color of line  subject = ['Physic','Chemistry','Mathematics', 'Biology','Computer'] marks =[80,75,70,78,82] # To draw line in red colour plt.plot(subject,marks,'r',marker ='*')     # To Write Title of the Line Chart plt.title('Marks Scored') # To Put Label At Y Axis plt.xlabel('SUBJECT')           # To Put Label At X Axis plt.ylabel('MARKS')             plt.show() Output :- 

Class 10th Chapter :- 14 Loop Control Structures

  Loop Control Structures   All programming languages offers loop control structure (also known as looping) allowing programmers to execute a statement or group of statements multiple times. In looping, the sequences of statements are executed until some exit condition is satisfied. The looping construct is composed of two parts: body of loop and control statement. In entry controlled loop the exit/control condition is checked before executions of statements inside loop body. In exit controlled loop the exit/control condition is checked after executions of loop body. This means that in case of exit controlled loop, body will be executed at least once before exiting from the loop.4 for while do...while The For Loop The for loop is normally used when we want to execute block of statements fixed number of times. To make for loop more dynamic, we can use the exit condition inside for loop. Syntax of For Loop for ( expression1; expression2; expression3) The header of for loop cont...