




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
this notes are design for those who have just started learning java these are some basic notes you must read it before going to the next step in learning java
Typology: Summaries
1 / 8
This page cannot be seen from the preview
Don't miss anything!
Beginner friendly
introduction to java history of java java version history features of java what is class? what is object? What is package? Data types in java. Two types of method in java Structure of java Variable in java Scanner class in java Adding to integers in java exercise INTRODUCTION TO JAVA -Java is an object oriented programing language. -but java is not fully object oriented language why?
Beginner friendly -because it consist primitive data types. -Java is a programming language and runs on various platform.
Java was originally designed for interactive television, but it was too advanced technology for the digital cable television industry at the time. It was developed by james Gosling in 1995 who was a member of a team called as Green Team from the sun microsystem. Java was originally named as Oak but then changed because it was already trademark by another company(Oak technologies). so, they changed it to java.
java syntax is based on c++. Java is object oriented language. It is very easy to learn, and its syntax are simple clean and easy to understand.
Beginner friendly Object is an instance of the class. What is package? Package is collection of classes. Which can be import in the program. DATA TYPES IN JAVA :- Two types of method in java :-
Beginner friendly Structure of java :- Write a program to print hello world in java. public class Hello { public static void main (String args[]) { System.out.println(“Hello world”); } } System.out.print – it works like printf in c language. It basically Prints the sentence. Static is a type of method which mean static method. Public is an access modifier String args[] is argument Void it means program will written nothing Class Hello is name of the class
Variables are the names of the storage locations. A declaration statement must end with a semicolon. Some valid declarations are: int count; float x, y; double pi;
Beginner friendly Output:- 30 By taking input from user Import java.util.*; public class sum { Public static void main(String args[]) { Scanner k=new Scanner(System.in) Int a,b; System.out.println(“enter the value of a : ”); a=k.nextInt(); System.out.println(“enter the value of b : ”); b=k.nextInt(); int sum=a+b; System.out.println(“the sum of the element is : ”+sum); } } Output:- Enter the value of a: 10 Enter the value of b: 20 The sum of the element is : 30 #DO IT YOURSELF subtraction of two integer
Beginner friendly division of two integer multiplication of two integer find average of 3 integer -also practice with scanner class by taking input from user Hope it helps