Connecting...

This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of Java
For more information, please see full course syllabus of Java
Java If Logic
Lecture Description
In this lesson our instructor talks about if logic. First, he talks about the mighty if, conditional statement in Java, pseudocode, and compound assignment operators. Then he discusses Boolean logical operators. Nine complete example videos round up this lesson.
Bookmark & Share
Embed
Share this knowledge with your friends!
Copy & Paste this embed code into your website’s HTML
Please ensure that your website editor is in text mode when you paste the code.(In Wordpress, the mode button is on the top right corner.)
×
Since this lesson is not free, only the preview will appear on your website.
- - Allow users to view the embedded video in full-size.
Next Lecture
Previous Lecture
0 answers
Post by Scott Yang on July 11, 2019
Number is spelled wrong in the basic if-else statement
1 answer
Wed Jan 1, 2014 5:38 PM
Post by Dionisis Mastavralis on December 31, 2013
Hi,
I haven't understand when you are using "public static void main(String[] args)" and when "public static void main(String args[])" ?
0 answers
Post by Phil Wyder on March 19, 2013
Hi
I have trouble running example 4 in netbeans. It always tells me that the main class is not found. If I try to run it in Terminal, I get the following error.
Main method not found in class triangle, please define the main method as:
public static void main(String[] args)
I blindly copied your text and tried to make it work. When I just add "public static void main(String[] args)" it also doesn't work. How can I make it work?
thanks,
Flipx
0 answers
Post by Phil Wyder on March 19, 2013
You may change the lecture slide "Boolean Logical Operators" and switch the y value back to 2. The very similar tables could be confusing who do not realize that the y value changed from 2 to 3. (Which isn't necessary anyway.) I think changing the example (x==2||y==2) to (x==3||y==3).
0 answers
Post by Gregory Gauthier on January 20, 2013
Aloha, I am trying like the devil to do a practice exercise from my book:
But I would really appreciate seeing the code so I can grasp my errors and stop spending hours going in circles:
Here it is:
Write a program that allows the user to convert a temperature given in degrees from either Celsius to Fahrenheit or Fahrenheit to Celsius. Use the following formulas:
Degrees_C = 5(Degrees_F- 32)/9
Degrees_F = (9(Degrees_C)/5) + 32)
Prompt the user to enter a temperature and either a C or c for Celsius or an F or f for Fahrenheit. Convert the temperature to Fahrenheit if Celsius is entered, or to Celsius if Fahrenheit is entered. Display the result in a readable format. If anything other that C,c,F, or f is entered, print an error message and stop.