Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean isValid() {
- boolean check;
- int number = 5;
- if (number > 4){
- check = true;
- } else {
- check = false;
- }
- return check;
- if(isValid == true) // <-- this is where I'm not sure
- //stop and go back to the beginning of the program
- else
- //continue on with the program
- if(isValid()) {
- // something
- } else {
- //something else
- }
- public boolean isValid() {
- int number = 5;
- return number > 4;
- }
- if (isValid()) {
- ...
- } else {
- ...
- }
- if (isValid()) {
- }else {
- }
- boolean tempBoo = isValid();
- if (tempBoo) {
- }else {
- }
- public boolean isValid() {
- boolean check = false; // always intialize the local variable
- int number = 5;
- if (number > 4){
- check = true;
- } else {
- check = false;
- }
- return check;
- }
- if(isValid()){
- // Do something if its true
- }else{
- // Do something if its false
- }
- if (isValid()) {
- // do something when the method returned true
- } else {
- // do something else when the method returned false
- }
- if(isValid())
- {
- }
- else
- {
- }
- if(isValid()){
- //do something....
- }
- else
- {
- //do something....
- }
- public boolean isValid() {
- boolean check;
- int number = 5;
- if (number > 4){
- check = true;
- } else {
- check = false;
- }
- return check;
Add Comment
Please, Sign In to add comment