Tech Jargon - Decoded
Открыть в Telegram
Confused by tech terms? Don’t worry, we’ve got you 🤝 We make things simple, one concept at a time. Learn daily Easy & clear Turn Confusion into clarity. #tech #it #softwareengineer #cs #development
Больше2 016
Подписчики
-124 часа
-57 дней
-4030 день
Архив постов
Grading Game: Can you assign grades based on marks using if-else in Java?
public class GradeCalculator {
public static void main(String[] args) {
int marks = 75;
char grade;
if (marks >= 90) {
grade = 'A';
} else if (marks >= 80) {
grade = 'B';
} else if (marks >= 70) {
grade = 'C';
} else if (marks >= 60) {
grade = 'D';
} else {
grade = 'F';
}
System.out.println("Marks: " + marks);
System.out.println("Grade: " + grade);
}
}Math Made Easy: Build a Simple Calculator in Java!
import java.util.Scanner;
public class SimpleCalculator {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter first number: ");
double num1 = scanner.nextDouble();
System.out.print("Enter an operator (+, -, *, /): ");
char operator = scanner.next().charAt(0);
System.out.print("Enter second number: ");
double num2 = scanner.nextDouble();
double result;
switch (operator) {
case '+':
result = num1 + num2;
break;
case '-':
result = num1 - num2;
break;
case '*':
result = num1 * num2;
break;
case '/':
if (num2 == 0) {
System.out.println("Error: Cannot divide by zero!");
return;
}
result = num1 / num2;
break;
default:
System.out.println("Error: Invalid operator!");
return;
}
System.out.println("Result: " + result);
scanner.close();
}
}Unlocking the Power of 'if-else': Can you find the biggest number?
public class MaxOfThree {
public static void main(String[] args) {
int num1 = 10;
int num2 = 5;
int num3 = 15;
int max;
if (num1 >= num2 && num1 >= num3) {
max = num1;
} else if (num2 >= num1 && num2 >= num3) {
max = num2;
} else {
max = num3;
}
System.out.println("The maximum number is: " + max);
}
}Is it positive, negative, or zero? 🤔 A Java number check!
public class NumberCheck {
public static void main(String[] args) {
int number = 10;
if (number > 0) {
System.out.println("Positive");
} else if (number < 0) {
System.out.println("Negative");
} else {
System.out.println("Zero");
}
}
}Is it hot or cold? 🤔 Using the ternary operator to decide!
public class TernaryExample {
public static void main(String[] args) {
int temperature = 20;
String weather = (temperature > 25) ? "Hot" : "Cold";
System.out.println("The weather is: " + weather);
}
}Wrapper Wonders: How to automatically convert between primitive types and objects in Java!
public class AutoboxingUnboxing {
public static void main(String[] args) {
Integer wrapperInt = 10;
int primitiveInt = wrapperInt;
Double wrapperDouble = 3.14;
double primitiveDouble = wrapperDouble;
System.out.println("Wrapper Integer: " + wrapperInt);
System.out.println("Primitive Integer: " + primitiveInt);
System.out.println("Wrapper Double: " + wrapperDouble);
System.out.println("Primitive Double: " + primitiveDouble);
int sum = wrapperInt + (int)wrapperDouble;
System.out.println("Sum: " + sum);
}
}Number Strings to Primitives: Unleash Java's Parsing Power! 🚀
public class StringToPrimitive {
public static void main(String[] args) {
String numStr = "123";
int numInt = Integer.parseInt(numStr);
System.out.println("Integer: " + numInt);
String doubleStr = "3.14";
double numDouble = Double.parseDouble(doubleStr);
System.out.println("Double: " + numDouble);
String booleanStr = "true";
boolean boolValue = Boolean.parseBoolean(booleanStr);
System.out.println("Boolean: " + boolValue);
}
}Can you reverse a string in Java without using built-in reverse()?
public class ReverseString {
public static void main(String[] args) {
String str = "hello";
String reversedStr = "";
for (int i = str.length() - 1; i >= 0; i--) {
reversedStr = reversedStr + str.charAt(i);
}
System.out.println(reversedStr);
}
}Are you old enough and rich enough to buy that fancy car? Let's check with Java!
public class CarEligibility {
public static void main(String[] args) {
int age = 20;
double income = 60000.0;
boolean hasLicense = true;
boolean isEligible = (age >= 18) && (income > 50000.0) && hasLicense;
System.out.println("Is eligible to buy a car? " + isEligible);
}
}Unlocking Java's Type Secrets: Widening and Narrowing Conversions!
public class TypeCasting {
public static void main(String[] args) {
int intValue = 100;
double doubleValue = intValue;
System.out.println("Implicit (Widening): int to double = " + doubleValue);
double anotherDouble = 123.45;
int anotherInt = (int) anotherDouble;
System.out.println("Explicit (Narrowing): double to int = " + anotherInt);
}
}
Уже доступно! Исследование Telegram 2025 — ключевые инсайты года 
