Skip to content

Added java explanatory code #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 5, 2021
Merged

Conversation

tanishagupta1
Copy link
Contributor

Fixes #4

Short description of what this resolves:

Improves operators.md with java code and operators

What Changes proposed in this pull request:

  • Added java code
  • removed cpp code
  • removed operators like comma, sizeof, reference and dereference which are not present in java

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added code examples, test must pass
  • Added documentation so that the program is self-explanatory and educational.
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

Added java code, removed cpp code, removed operators like comma, sizeof, reference and dereference which are not present in java
Comment on lines 208 to 216
public class Main
{
public static void main(String[] args) {
char ch = 'a';
int typecasted_character = (int)'a';
System.out.println(ch);
System.out.println(typecasted_character);
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class Main
{
public static void main(String[] args) {
char ch = 'a';
int typecasted_character = (int)'a';
System.out.println(ch);
System.out.println(typecasted_character);
}
}
public class Main {
public static void main(String[] args) {
char ch = 'a';
int typecasted_character = (int) 'a';
System.out.println(ch);
System.out.println(typecasted_character);
}
}

here also

Comment on lines 192 to 201
public class Main
{
public static void main(String[] args) {
int num=15;
String msg = num > 10
? "Number is greater than 10"
: "Number is less than or equal to 10";
System.out.println(msg);
}
```
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class Main
{
public static void main(String[] args) {
int num=15;
String msg = num > 10
? "Number is greater than 10"
: "Number is less than or equal to 10";
System.out.println(msg);
}
```
}
public class Main {
public static void main(String[] args) {
int num = 15;
String msg = num > 10 ? "Number is greater than 10" : "Number is less than or equal to 10";
System.out.println(msg);
}
}

Please fix the indentation

Copy link
Owner

@Utkarsh1504 Utkarsh1504 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please fix the indentation, else everything is great. :octocat:
👍🏻

tanishagupta1 and others added 2 commits October 5, 2021 11:21
indentation resolved

Co-authored-by: Utkarsh Mishra <76392681+Utkarsh1504@users.noreply.github.com>
Copy link
Owner

@Utkarsh1504 Utkarsh1504 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you :octocat: 👍🏻

@Utkarsh1504 Utkarsh1504 added approved for approved PRS hacktoberfest-accepted eligible PRs for hactoberfest ✅ Ready for merge approved pull request labels Oct 5, 2021
@Utkarsh1504 Utkarsh1504 merged commit acf4622 into Utkarsh1504:main Oct 5, 2021
@tanishagupta1 tanishagupta1 deleted the operators branch October 5, 2021 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved for approved PRS hacktoberfest-accepted eligible PRs for hactoberfest ✅ Ready for merge approved pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve: Operators in Java
2 participants