Wednesday, December 14, 2022

Assignment of Arithmetic Operators Java | Tutorial for Beginners

 In this tutorial you will learn how to create and call non static method . We will create method and do operation of addition, subtraction, multiplication,  and division. If you want video tutorial here is link in English and in Hindi language. So lets create some basic math calculator. 

Java Tutorial in English  


Java Tutorial in Hindi






Lets create class and and check mark on public static void main so it will create main method where we call .

Now we will create method .we used void since we do not want to return but just print . After method we will use bracket and then curly brace and we will write our logic here. we will create variable a and b and provide value, since we want to add we created another variable name result and we will adding a and b since this hold value of first and second value. And finally we want to print this but we only created non static method but not calling . But we now in main method since it is entry point. 


public void myAdd(){

int a = 2;

int b =3;

int result =(a+b);

System.out.println(result);

}

Syntax of calling non static method first we will type name of class and then name variable then equal sign for assignment and new word, then class name and bracket. Since we have created object. Now type that and use dot now will get list of all method which we can access.  We select our method then click on run and check output. 

Now we will create method and we will change assignment for subtraction, (a -b) and we observe in output, Now we will do for multiplication and division . 



If you want to watch  more video click on 

https://www.youtube.com/@amazingcodingtechworld

 

Wednesday, December 7, 2022

How to create and call Java non static method | Tutorial for Beginners

 In this java beginners tutorial we will learn about how to create and call non static method step by step .  This is very important concept we will create method and will call in main method if you want to watch video in either English or Hindi Language click on below link. 

Java Tutorial in English Language
Java Tutorial in Hindi Language

We will create method in same class . So first let create class. 

As seen in above picture we have created class and check mark on public static Void main and click on Finish. Now we will get auto generated main method in Java. 
Now create method in same class. 

public void myFirstMethod(){
System.out.println("Hello This is my Method");
}

To create method we use public access modifier so we can access in same package. We are not returning anything so we have used void word. we provide name of method and bracket and then curly brace , where inside we will write out logic. For now we are just printing Hello.....method but later we will play this in next tutorial.  
So java non static method creation is done now we have to call this method . So lets learn how to call this method?
if we would have use static method we do not need to create object instead we can call directly by using class name however this is not static method so we have to create object.
myJavaNonStaticMethod mjm = new myJavaNonStaticMethod();
mjm.myFirstMethod();

In the main method we will use same name class name and create variable and them we use = for assignment and new word and class name and bracket . now we store object in variable named mjm. If we type mjm and then dot we will get all method which we can access of them but for now we will select method which we created earlier . 

Now we run this method , for running method we will click on green arrow if eclipse observe out put. 

we can observe we got output as we expected. if you want to learn more here is link of few more videos .https://www.youtube.com/@amazingcodingtechworld/playlists

 

Wednesday, November 30, 2022

How to learn variable Data type Program | Java Tutorial for Beginners

In this tutorial we will learn about how to create variable to java data type and how to use it with practical step by step example. 

If you want to follow along, click on video tutorial which are available in Hindi and English languages. 


                               Java  primitive Data type tutorial in English

Java  primitive Data type tutorial in Hindi




Java Integer 

    



If we want to use or declare  integer, we type int then name of variable in this example point is name of variable which hold value which 5 and for assign  we use =.  since we store value in variable call point now we can use it. lets print out  in console.  we have main method  and print in console we have system.out.println command and we use semicolon at the end .Now click on Green button to run program but first save before run and check in console. we can observe 5 in console. Integer uses 4 bytes of memory and can store whole number start form -2147483648 to 2147483647. 

Java Primitive data type Byte
Byte is  primitive datatype of Java. which can hold whole number from -128 to 127 and use 1 byte of size. 
to declare byte we type byte and created variable(num) which hold value 10 and we will print it . Now save program and click on run and observe you can 10 in console as describe in image. 


                            Java Primitive data type Short

Short is another datatype of Java which can hold whole number from -32768to 32767 and use size of 2 bytes.  To declare short we use short and created variable name price which hold value 15. for assign we use equal sign and we are printing value in console as we can observe in below picture.


                           Java Primitive data type Long
Long is one of the data type of Java and we can use if we have large number , since it can hold large number as result it will take 8 bytes of memory and can hold whole number from -9223372036854775808 to 9223372036854775807. To declare long we use long as data type , we use store as name of variable and printing in console. 


Java Primitive data type Float
All above data type we use for if number is whole but if number is in fraction or not whole number? In Java we use float or double so lets see how to use it. 
Float can hold 6 to 7 fractional number and take 4 bytes of memory . 
where double can hold 15 decimal number and take 8 bytes of  memory. To declare double datatype we use double and we assign value 3.25 to variable name cake and we are printing this in main method . we can see 3.25 value is print out in out put. 



              Java Primitive data type Character 
If we want to store single character we can use this data type in Java. Which can store single value and take 2 byte of memory .  Lets take an example. To declare character we use char as data type and we used  math as variable for value we use single invited comma as described in below image. 
    


Java Primitive data type String
If we want to use more that one character we can use String . Unlike character we will provide double invited comma to value . lets take and example of String. To declare string we use string as datatype and we assign value in last name variable now we will print and check out put. 


Java Primitive data type Boolean
Boolean is either true or false . This is very important data type  we will use this in future tutorial a lot. Boolean will take 1 byte of  memory.  lets check an example. To declare Boolean data type we use boolean and we created variable and set as true and we printed in console

Now here important things to know we can use same data type for many circumstances but if we know how much memory it uses we can use or choose data type wisely for an example if we want to store value as 25 .  we can use byte , shorts, int, long but is it good idea ? check memory usage and select what data type is ideal to use. If you would like to lean more please click on below link




 

Wednesday, November 23, 2022

Lean How make Java hello world first program java | Tutorial for Beginners

If you want learn Java , lets make simple first program Hello world.  This is the way to learn so we have make step be step tutorial . 

So what you need to learn ? there is few pre-requisite. But how to check if Java is installed in your computer? Simple open command prompt , type CMD in search bar and enter "javac" is java is installed then you will find some  options if you do not find then you have to download install and set up environment. https://www.oracle.com/java/

Now we have to write code somewhere so we need code editor , there is lots of benefits to code editor. you will suggestion what to use and get error message if you make mistake and possible suggestion which lighten your work . There are lots of code editor available. https://www.jetbrains.com/idea/download/download-thanks.html?platform=windows&code=IIC

But we are using eclipse  https://www.eclipse.org/downloads/ download according to computer system.

You can watch this same tutorial in Hindi and English language . Please click on below links. 

Video in English


Video in Hindi



Click on File option , now click on New and then java project if you do not have this options then click on other, Type java project now you will option now select and click on Next as seen in below image. 
Provide name of project and click on Finish.


Now you can observe as below image that project is created and if you expand by down error you will have src folder , right click on that. Click on new then Class . 

Enter Name of Class , in this example we have used hello world , click on check mark of public static void main and click on finish .


Now you can observe that you created class and main method since we have check marked while creating class. 


Lets type system.out.println , by using this command in main method will help to write hello world in console. you can remove or keep // TODO Auto-generated method stub. since it marked with two // it means it will ignore this comment. and we will type hello world in '' '' since it is string. we will see this datatype in more detail in next tutorial .And making sure we will add semicolon  after (end of) code) otherwise system will through error message. 


Now click on Run , it is green error button and observe in console. 



  Congratulations!!! you have made first easy and simple java program for beginners .  For more video tutorial click on this link @amazingcodingtechworld


Saturday, October 23, 2021

What is US Army Non Commissioned Officer Creed and how to remember

NCOCreed

US Army Non Commissioned Officer Creed with voice


NCO creed is very important in US Army. NCO Creed teaches what supposed to do, what is duty of Non Commissioned Officer by kind of swearing or oath. It also reminds what is ideal leader's duty. It is so Vital to know in occassion of Promotion Board.

If you listen every day you will remember NCO Creed

If you are busy and still want to recite creed.Click below button to hear/ listen to NCO creed


No one is more professional than I.
I am a noncommissioned officer, a leader of Soldiers.
As a noncommissioned officer, I realize that I am a member of a time honored corps, which is known as "The Backbone of the Army".
I am proud of the Corps of noncommissioned officers and will at all times conduct myself so as to bring credit upon the Corps, the military service and my country regardless of the situation in which I find myself.
I will not use my grade or position to attain pleasure, profit, or personal safety.
Competence is my watchword.
My two basic responsibilities will always be uppermost in my mind—accomplishment of my mission and the welfare of my Soldiers.
I will strive to remain technically and tactically proficient.
I am aware of my role as a noncommissioned officer.
I will fulfill my responsibilities inherent in that role.
All Soldiers are entitled to outstanding leadership; I will provide that leadership.
I know my Soldiers and I will always place their needs above my own.
I will communicate consistently with my Soldiers and never leave them uninformed.
I will be fair and impartial when recommending both rewards and punishment.
Officers of my unit will have maximum time to accomplish their duties; they will not have to accomplish mine.
I will earn their respect and confidence as well as that of my Soldiers.
I will be loyal to those with whom I serve; seniors, peers, and subordinates alike.
I will exercise initiative by taking appropriate action in the absence of orders.
I will not compromise my integrity, nor my moral courage.
I will not forget, nor will I allow my comrades to forget that we are professionals, noncommissioned officers, leaders!

*************Download free app to practice ASVAB and Promotion board********


Free ASVAB Practice Test Flashcard App
Free US Army Promotion Board Study Guide Flashcard App
Free Army Promotion Board Study Guide App

Monday, September 27, 2021

US Army Soldier's Creed

SoldiersCreed

US Army Soldier's Creed


Soldier's creed is very important for every Soldier in US Army. Soldier's Creed teaches soldier what supposed to do, what is duty of soldier by kind of swearing or oath. Trainee will recite Soldier's Creed during basic training. It is so Vital to know in occassion of Promotion Board.

If you are busy and still want to recite creed.Click below button to hear/ listen to soldier's creed


I am an American Soldier.
I am a warrior and a member of a team.
I serve the people of the United States, and live the Army Values.
I will always place the mission first.
I will never accept defeat.
I will never quit.
I will never leave a fallen comrade.
I am disciplined, physically and mentally tough, trained and proficient in my warrior tasks and drills.
I always maintain my arms, my equipment and myself.
I am an expert and I am a professional.
I stand ready to deploy, engage, and destroy, the enemies of the United States of America in close combat.
I am a guardian of freedom and the American way of life.
I am an American Soldier.

*************Download free app to practice ASVAB and Promotion board********


Free ASVAB Practice Test Flashcard App
Free US Army Promotion Board Study Guide Flashcard App
Free Army Promotion Board Study Guide App

Wednesday, September 22, 2021

Civics (History and Government) Questions for the Naturalization Practice Test

USCitizenshipCivivPracticeTest

Civics (History and Government) Questions for the Naturalization Practice Test

We have covered Civics Questions for the Naturalization practice Test. You can work, cook, eat and Listen or read Question and answer and prepare for test

Press Listen button for listen question and answer and click stop to end. For best result use chrome browser.


Question 1 What is the supreme law of the land?
The Constitution
Question 2 What does the Constitution do?
Sets up the government, defines the government and protects basic rights of Americans
Question 3 The idea of self-government is in the first three words of the Constitution. What are these words?
We the People
Question 4 What is an amendment?
change and an addition to the Constitution
Question 5 What do we call the first ten amendments to the Constitution?
the Bill of Rights
Question 6 What is one right or freedom from the First Amendment?
speech, religion, assembly, press and petition the government
Question 7 What did the Declaration of Independence do?
Announced our independence or declared our independence from Great Britain
Question 8 How many amendments does the Constitution have?
twenty-seven
Question 9 What are two rights in the Declaration of Independence?
life, liberty, pursuit of happiness
Question 10 What is the economic system in the United States?
Capitalist economy
Question 11 What is freedom of religion?
Practice any religion
Question 12 What is the “rule of law”?
Everyone must follow the law, Leaders must obey the law, Government must obey the law, No one is above the law
Question 13 Name one branch or part of the government.
Congress, legislative, President, executive, courts, judicial
Question 14 What stops one branch of government from becoming too powerful?
checks and balances, separation of powers
Question 15 Who makes federal laws?
Congress, Senate and House, legislature
Question 16 Who is in charge of the executive branch?
The President
Question 17 What are the two parts of the U.S. Congress?
The Senate and House
Question 18 How many U.S. Senators are there?
One hundred
Question 19 We elect a U.S. Senator for how many years?
Six
Question 20 The House of Representatives has how many voting members?
four hundred thirty-five
Question 21 We elect a U.S. Representative for how many years?
Two
Question 22 Who does a U.S. Senator represent?
All people of the state
Question 23 Why do some states have more Representatives than other states?
The state’s population , they have more people, some states have more people
Question 24 We elect a President for how many years?
Four
Question 25 In what month do we vote for President?
November
Question 26 What is the name of the President of the United States now in 2021?
Joe Biden
Question 27 What is the name of the Vice President of the United States now in 2021?
Kamala Harris
Question 28 If both the President and the Vice President can no longer serve, who becomes President?
The Speaker of the House
Question 29 Who is the Commander in Chief of the military?
The President
Question 30 Who signs bills to become laws?
The President
Question 31 Who vetoes bills?
The President
Question 32 What does the President’s Cabinet do?
Advises the President
Question 33 What are two Cabinet-level positions?
Secretary of Agriculture, Secretary of Commerce, Secretary of Defense,,Secretary of Education, Secretary of Energy,Secretary of Health and Human Services, Secretary of Homeland Security,Secretary of Housing and Urban Development,Secretary of the Interior, Secretary of Labor, Secretary of State, Secretary of Transportation, Secretary of the Treasury, Secretary of Veterans Affairs, Attorney General, Vice President
Question 34 What does the judicial branch do?
Reviews laws, Explains laws, resolves disputes, decides if a law goes against the Constitution
Question 35 What is the highest court in the United States?
The Supreme Court
Question 36 Under our Constitution, some powers belong to the federal government. What is one power of the federal government?
To print money, declare war, create an army and to make treaties
Question 37 Under our Constitution, some powers belong to the states. What is one power of the states?
provide schooling and education, protection , safety, give a driver’s license,approve zoning and land use
Question 38 What are the two major political parties in the United States?
Democratic and Republican
Question 39 There are four amendments to the Constitution about who can vote. Describe one of them
Citizens eighteen and older can vote, Any citizen can vote
Question 40 What is one responsibility that is only for United States citizens?
serve on a jury, vote in a federal election
Question 41 Name one right only for United States citizens.
vote in a federal election, run for federal office
Question 42 What are two rights of everyone living in the United States?
freedom of expression, freedom of speech, freedom of assembly, freedom to petition the government, freedom of religion, the right to bear arms
Question 43 What do we show loyalty to when we say the Pledge of Allegiance?
the United States, the flag
Question 44 What is one promise you make when you become a United States citizen?
give up loyalty to other countries, defend the Constitution and laws of the United States, obey the laws of the United States, serve in the U.S. military if needed, be loyal to the United States
Question 45 How old do citizens have to be to vote for President?
eighteen and older
Question 46 What are two ways that Americans can participate in their democracy?
vote, join a political party, help with a campaign, join a civic group, join a community group, give an elected official your opinion on an issue, call Senators and Representatives, publicly support or oppose an issue or policy, run for office
Question 47 When is the last day you can send in federal income tax forms?
April 15
Question 48 When must all men register for the Selective Service?
at age eighteen, between eighteen and twenty-six
Question 49 What is one reason colonists came to America?
freedom, political liberty, religious freedom, economic opportunity, practice their religion, escape persecution
Question 50 Who lived in America before the Europeans arrived?
American Indians, Native Americans
Question 51 What group of people was taken to America and sold as slaves?
Africans, people from Africa
Question 52 Why did the colonists fight the British?
high taxes , British army stayed in their houses , didn’t have self-government
Question 53 Who wrote the Declaration of Independence?
Thomas Jefferson
Question 54 When was the Declaration of Independence adopted?
July 4, 1776
Question 55 There were 13 original states. Name three
New Hampshire, Massachusetts, Rhode Island, Connecticut, New York, New Jersey,Pennsylvania, Delaware, Maryland, Virginia, North Carolina, South Carolina, Georgia
Question 56 What happened at the Constitutional Convention?
The Constitution was written, The Founding Fathers wrote the Constitution.
Question 57 When was the Constitution written?
1787
Question 58 The Federalist Papers supported the passage of the U.S. Constitution. Name one of the writers.
James Madison, Alexander Hamilton, John Jay, Publius
Question 59 What is one thing Benjamin Franklin is famous for?
U.S. diplomat, oldest member of the Constitutional Convention, first Postmaster General of the United States,writer of Poor Richard’s Almanac,started the first free libraries
Question 60 Who is the Father of Our Country?
George Washington
Question 61 Who was the first President?
George Washington
Question 62 What territory did the United States buy from France in 1803?
Louisiana Territory
Question 63 Name one war fought by the United States in the 1800s
War of 1812, Mexican-American War, Civil War, Spanish-American War
Question 64 Name the U.S. war between the North and the South.
Civil War
Question 65 Name one problem that led to the Civil War
slavery,economic reasons, states’ rights
Question 66 What was one important thing that Abraham Lincoln did
freed the slaves Emancipation Proclamation, saved the Union, led the United States during the Civil War
Question 67 What did the Emancipation Proclamation do?
reed the slaves, freed slaves in the Confederacy, freed slaves in the Confederate states, freed slaves in most Southern states
Question 68 What did Susan B. Anthony do?
fought for women’s rights, fought for civil rights
Question 69 Name one war fought by the United States in the 1900s
World War 1, World War 2, Korean War, Vietnam War, Gulf War
Question 70 Who was President during World War 1?
Woodrow Wilson
Question 71 Who was President during the Great Depression and World War 2 ?
Franklin Roosevelt
Question 72 Who did the United States fight in World War 2?
Japan, Germany, and Italy
Question 73 Before he was President, Eisenhower was a general. What war was he in?
World War 2
Question 74 During the Cold War, what was the main concern of the United States?
Communism
Question 75 What movement tried to end racial discrimination?
civil rights
Question 76 What did Martin Luther King, Jr. do?
fought for civil rights, worked for equality for all Americans
Question 77 What major event happened on September 11, 2001, in the United States?
Terrorists attacked the United States
Question 78 Name one American Indian tribe in the United States
Cherokee, Navajo, Sioux, Chippewa,Choctaw, Pueblo, Apache,Iroquois, Creek, Blackfeet, Seminole, Cheyenne, Arawak, Shawnee, Mohegan, Huron, Oneida, Lakota, Crow, Teton, Hopi, Inuit
Question 79 Name one of the two longest rivers in the United States
Missouri, Mississippi
Question 80 What ocean is on the West Coast of the United States?
Pacific
Question 81 What ocean is on the East Coast of the United States?
Atlantic
Question 82 Name one U.S. territory.
Puerto Rico, U.S. Virgin Islands, American Samoa, Northern Mariana Islands, Guam
Question 83 Name one state that borders Canada.
Maine, New Hampshire, Vermont, New York, Pennsylvania, Ohio, Michigan, Minnesota, North Dakota, Montana, Idaho, Washington, Alaska
Question 84 Name one state that borders Mexico.
California, Arizona , New Mexico, Texas
Question 85 What is the capital of the United States?
Washington D.C
Question 86 Where is the Statue of Liberty?
New York, Liberty Island
Question 87 Why does the flag have 13 stripes?
because there were 13 original colonies, stripes represent the original colonies
Question 88 Why does the flag have 50 stars?
each star represents a state and there are 50 states or there is one star for each state
Question 89 What is the name of the national anthem?
The Star-Spangled Banner
Question 90 When do we celebrate Independence Day?
July 4
Question 91 Name two national U.S. holidays.
Martin Luther King, Jr. Day, New Year’s Day, Presidents’ Day, Memorial Day, Independence Day, Labor Day, Columbus Day, Veterans Day, Thanksgiving, Christmas

Structured Self-Development (SSD) Level 2 Module 1, 2, and 3

Assignment of Arithmetic Operators Java | Tutorial for Beginners

  In this tutorial you will learn how to create and call non static method . We will create method and do operation of addition, subtraction...