Commit 0e288b34 authored by Arsam Ali's avatar Arsam Ali

upskills update of Data Types , Syntax , Variables

parent 8a2b180b
package Upskills_Training.DataTypes;
public class Categories {
// @Test(groups = "smoke")
// public void test1() {
// // Test code
// }
//
// @Test(groups = "regression")
// public void test2() {
// // Test code
// }
//
// @Test(groups = {"smoke", "regression"})
// public void test3() {
// // Test code
// }
}
package Upskills_Training.Syntax;
import java.util.Scanner;
public class CaseSensitivity {
public static void main(String[] args) {
//=====================================================
//Daraz Login Page
// LOGIN BUTTON
//DashboardLoginButton
//=====================================================
//EMAIL & PASSWORD FIELDS
//LoginPageEmailOrNumber
//LoginPagePassword
//ResetYourPassword
//=====================================================
//FOOTER
//FooterCustomerCare
}
}
package Upskills_Training.Syntax;
public class ClassNames {
//If you are naming any class then it should be a noun and so should be named as per the goal
//Mobile
//Student
//Cat
//
//Interface Names "able should be placed with every interface"
//Readable
//Runnable
}
package Upskills_Training.Syntax;
public class Comments {
// Click on the login button
//driver.findElement(By.id("loginButton")).click();
//
// driver.findElement(By.id("submitButton")).click(); // Temporarily disable the submit button click
//Test Case Comments
/*
* Test Case: Verify login functionality with valid credentials
* Steps:
* 1. Enter valid username
* 2. Enter valid password
* 3. Click on the login button
* Expected Result: User should be logged in successfully
*/
// Define the format for date of birth (DOB) in MM/DD/YYYY format
// String dobFormat = "MM/dd/yyyy";
}
package Upskills_Training.Syntax;
public class FileNames {
//In Java, the java file name should be always the same as a public class name
// Descriptive Nouns:
//
// These class names clearly describe the object they represent.
// Customer
// Order
// Product
// FileHandler
// NetworkManager
//2. Compound Nouns:
// Use camelCase (first word lowercase, subsequent words uppercase) for compound nouns.
// WebServer
// EmailClient
// DatabaseConnection
// UserInterfaceController
// ShoppingCart
}
package Upskills_Training.Syntax;
public class Keywords {
//PUBLIC
// public class AutomationTestClass {
// public void performAutomation() {
// // Method code
// }
// }
//PRIVATE
// public class AutomationTestClass {
// private String username;
//
// private void setUsername(String username) {
// this.username = username;
// }
// }
//STATIC
// public class AutomationTestClass {
// public static void printMessage() {
// System.out.println("Hello, world!");
// }
// }
//INHERITANCE
// public class SubTestClass extends AutomationTestClass {
// // Subclass methods and variables
// }
// INHERIT WITH INTERFACE
// public class ImplementTestClass implements AutomationInterface {
// // Implementations for methods in AutomationInterface
// }
//RETURN
// public int add(int a, int b) {
// return a + b;
// }
}
package Upskills_Training.Syntax;
public class MainMethods {
// public static void main(String[] args) {
// MainMethods mainMethod = new MainMethods();
// mainMethod.runAutomation();
// }
//
// public void runAutomation() {
// System.out.println("Automation script starting...");
// }
// }
}
package Upskills_Training.Syntax;
public class MethodsName {
//Now if we do look closer a method is supposed to do something that it does contains in its body henceforth it should be a verb
//1. Verbs Describing Actions:
// Method names should clearly describe the action they perform on the object.
// calculateArea()
// openFile()
// sendData()
//2. Descriptive Phrases (For Complex Actions):
// For methods with complex functionalities, consider using a descriptive phrase.
// processOrderPayment()
// generateCustomerReport()
// connectToRemoteDatabase()
}
package Upskills_Training.Variables;
public class ExplanationOfEach {
public static void main (String [] args) {
// for (initialization; condition; update) {
// // Outer loop code
// for (initialization; condition; update) { //nested loop
// // Inner loop code
// }
// }
// int[] numericValues = {1, 2, 3, 4, 5, 6};
// for (int number:numericValues) {
// System.out.println(number);
// }
// String name = "Arsam";
//
// for (char ch:name.toCharArray()) {
//
// System.out.println(ch);
//
// }
}
}
package Upskills_Training.Variables;
public class TypesOfVariables {
public static void main(String[] args) {
//String,int,Float,double,char,boolean
// int myNum = 5;
// float myFloatNum = 5.99f;
// char myLetter = 'D';
// boolean myBool = true;
// String myText = "Hello";
//String
String laptop = "Macbook-pro";
System.out.println(laptop);
//int
int myNumber = 200;
myNumber = 100;
System.out.println(myNumber);
//Float
float myNumberFloat = 2.3f;
System.out.println(myNumberFloat);
//char
char character = 'A';
System.out.println(character);
//boolean
boolean checkStatus = true;
System.out.println(checkStatus);
}
}
package Upskills_Training.Variables;
public class ValuesAssignments {
public static void main(String[] args) {
int num;
String name;
// Assigning values
num = 10;
name = "Java Up skills";
System.out.println("num is assigned: " + num);
System.out.println("name is assigned: " + name);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment