UrbanPro
true

Take BCA Tuition from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Learn Java Programming with Free Lessons & Tips

Ask a Question

Post a Lesson

All

All

Lessons

Discussion

Lesson Posted on 22/11/2021 Learn Java Programming +6 Selenium Selenium with Java Java Core Java Automation Testing Software Testing

Priority in TestNG

Sarthak

public class Priority { @Test (priority=1)public void login() {System.out.println("login");} @Testpublic void email1() {System.out.println("email1");} @Test (priority=-2)public void email2() {System.out.println("email2");} //I want a particular test case to run first ....we have to give the ordering //by... read more

public class Priority {

@Test (priority=1)
public void login() {
System.out.println("login");
}

@Test
public void email1() {
System.out.println("email1");
}

@Test (priority=-2)
public void email2() {
System.out.println("email2");
}

//I want a particular test case to run first ....we have to give the ordering

//by default priority=0
//-3 -2 -1 0 1 2 3
//if we have the same priority of 2 test cases then it will run in chronological order
}

read less
Comments
Dislike Bookmark

Lesson Posted on 18/11/2021 Learn Java Programming +4 Selenium Selenium with Java Java Core Java

doWhile example in Java

Sarthak

public class doWhilePracticleEx { public void test() { } public static void main(String args) { String q1 = "Who is PM of India?"; String a1 = "Sonia Gandhi"; String a2 = "Rahul Gandhi"; String a3 = "Amit Shah"; String a4 = "Narendra Modi"; System.out.println(q1); System.out.println(a1); System.out.println(a2);... read more

public class doWhilePracticleEx {

public void test() {

}

public static void main(String args[]) {

String q1 = "Who is PM of India?";
String a1 = "Sonia Gandhi";
String a2 = "Rahul Gandhi";
String a3 = "Amit Shah";
String a4 = "Narendra Modi";


System.out.println(q1);
System.out.println(a1);
System.out.println(a2);
System.out.println(a3);
System.out.println(a4);
String user="";

int attemptCount=1; //no of attempts

do {
if(attemptCount==1) {
System.out.println("Enter Your answer");
}
Scanner sc = new Scanner(System.in);
//control + shift+ o
user = sc.nextLine();
attemptCount++;


} while(!user.equalsIgnoreCase(a4));
System.out.println("Your answer is correct!!!!!");
}

}

read less
Comments
Dislike Bookmark

Lesson Posted on 18/11/2021 Learn Java Programming +4 Selenium Selenium with Java Java Core Java

ListIterator Example

Sarthak

public class ListIteratorEx { public static void main(String args) { List<String> li = new ArrayList<String>(); li.add("java1"); li.add("java2"); li.add("java3"); li.add("java4"); ListIterator itr = li.listIterator(); while(itr.hasNext()) { System.out.println(itr.next()); } System.out.println(itr.nextIndex());... read more

public class ListIteratorEx {

public static void main(String args[]) {

List<String> li = new ArrayList<String>();
li.add("java1");
li.add("java2");
li.add("java3");
li.add("java4");


ListIterator itr = li.listIterator();
while(itr.hasNext()) {
System.out.println(itr.next());
}

System.out.println(itr.nextIndex());

System.out.println(itr.previousIndex());

}

}

read less
Comments
Dislike Bookmark

Take BCA Tuition from the Best Tutors

  • Affordable fees
  • Flexible Timings
  • Choose between 1-1 and Group class
  • Verified Tutors

Lesson Posted on 18/11/2021 Learn Java Programming +7 Selenium Selenium with Java Java Core Java Software Testing Automation Testing IT Automation

TestNG Annotations and its sequence

Sarthak

public class TestNGAnnotations { @BeforeMethod public void beforeM() { System.out.println("Before Method"); } @AfterMethod public void afterMethod() { System.out.println("After Method"); } @BeforeClass public void beforeCl() { System.out.println("Before Class"); } @AfterClass public void afterCls()... read more

public class TestNGAnnotations {

@BeforeMethod
public void beforeM() {
System.out.println("Before Method");
}

@AfterMethod
public void afterMethod() {
System.out.println("After Method");
}

@BeforeClass
public void beforeCl() {
System.out.println("Before Class");
}

@AfterClass
public void afterCls() {
System.out.println("After Class");
}

//Certain code before each Testname
@BeforeTest
public void beforeT() {
System.out.println("Before Test");
}

@AfterTest
public void afterT() {
System.out.println("after Test");
}

@BeforeSuite
public void beforeSuite() {
System.out.println("before Suite");
}

@AfterSuite
public void afterSuite() {
System.out.println("after Suite");
}


@Test
public void testcase1() {
System.out.println("testcase1");
}

@Test
public void testcase2() {
System.out.println("testcase2");
}

}

read less
Comments
Dislike Bookmark

Lesson Posted on 18/11/2021 Learn Java Programming +6 Selenium Selenium with Java Java Core Java Automation Testing Software Testing

Example of DependsOnMethod in TestNG

Sarthak

public class dependsonM { @Test public void login() { System.out.println("login"); } @Test (dependsOnMethods = {"login"}) public void email() { //Intentionally I am failing this testcase Assert.assertTrue(false); System.out.println("logout"); } @Test (dependsOnMethods = {"login", "email"}) public... read more

public class dependsonM {

@Test
public void login() {

System.out.println("login");
}


@Test (dependsOnMethods = {"login"})
public void email() {
//Intentionally I am failing this testcase
Assert.assertTrue(false);
System.out.println("logout");
}


@Test (dependsOnMethods = {"login", "email"})
public void logout() {
System.out.println("logout");
}

}

read less
Comments
Dislike Bookmark

Lesson Posted on 06/07/2021 Learn Java Programming +2 Java Core Java

Java Advantages

Ranjit Singh

I have rich Experience in giving tuition to primary to secondary school along with students from various...

In this video, learn about Java and its advantages. Also, check out the difference between Java and C++, Java development kit, Java Run Time Environment (JRE) with a proper demonstration program for better clarity. read more

In this video, learn about Java and its advantages. Also, check out the difference between Java and C++, Java development kit, Java Run Time Environment (JRE) with a proper demonstration program for better clarity.

 

read less
Comments
Dislike Bookmark

Take BCA Tuition from the Best Tutors

  • Affordable fees
  • Flexible Timings
  • Choose between 1-1 and Group class
  • Verified Tutors

Answered on 17/07/2021 Learn Java Programming +3 Java Java Script Training Core Java

Kapil Chugh

Assistant Professor (Computer Sci.) with 15+ years of teaching experience

There are some reasons. First, it is open-source. It helps in the fast development of web apps with minimal coding. We can break down the complex work of creating UI components into smaller pieces. Developers can write their apps within JavaScript. Big companies like Facebook, PayPal, Uber, Instagram,... read more

There are some reasons. First, it is open-source. It helps in the fast development of web apps with minimal coding. We can break down the complex work of creating UI components into smaller pieces. Developers can write their apps within JavaScript.

Big companies like Facebook, PayPal, Uber, Instagram, and Airbnb use it to solve user interface related issues.

read less
Answers 1 Comments 1
Dislike Bookmark

Answered on 02/06/2021 Learn Java Programming +3 Java Java Script Training Core Java

Sangita K.

Dear Sandeep, You have asked a question that many people ask, and it shows that you have the curiosity in your mind to learn. This era of technology has made it possible for quality courses to be accessible by all. If you want to learn design, code and Data structure, I would suggest taking classes on... read more

Dear Sandeep,

You have asked a question that many people ask, and it shows that you have the curiosity in your mind to learn. This era of technology has made it possible for quality courses to be accessible by all. If you want to learn design, code and Data structure, I would suggest taking classes on coding and data structure from the YouTube channel Code With Harry. The courses are for free and are in Hindi. I have referred it to many others, and most of them have been benefited from it.

I wish you luck.

read less
Answers 1 Comments
Dislike Bookmark

Answered on 14/05/2021 Learn Java Programming +3 Java Java Script Training Core Java

Palak Bhalla

Angular 4 is the latest version of Angular. Although Angular 2 was a complete rewrite of AngularJS, there are no major differences between Angular 2 and Angular 4. Angular 4 is only an improvement and is backwards compatible with Angular 2.
Answers 2 Comments
Dislike Bookmark

Take BCA Tuition from the Best Tutors

  • Affordable fees
  • Flexible Timings
  • Choose between 1-1 and Group class
  • Verified Tutors

Answered on 25/04/2021 Learn Java Programming +3 Java Java Script Training Core Java

Arunava Biswas

bored of old-schooled teaching? let me show you the millenial way..

this.is my php file: $con = mysqli_connect($HostName,$HostUser,$password,$db); // Getting the received JSON into $json variable. $json = file_get_contents('php://input'); // decoding the received JSON and store into $obj variable. $obj = json_decode($json,true); // Populate ID from JSON $obj... read more

this.is my php file:

$con = mysqli_connect($HostName,$HostUser,$password,$db);

 // Getting the received JSON into $json variable.
 $json = file_get_contents('php://input');

 // decoding the received JSON and store into $obj variable.
 $obj = json_decode($json,true);

 // Populate ID from JSON $obj array and store into $ID.
$ID = $obj['numero'];

//Fetching the selected record.
$CheckSQL = "SELECT origine FROM envoi WHERE numero='$ID'";

$result = $con->query($CheckSQL);

if ($result->num_rows >0) {
 while($row[] = $result->fetch_assoc()) {
 $Item = $row;
 $json = json_encode($Item);
 echo $json;
 }
}
else {  
 $EmailExistMSG= "No Results Found.";
 $EmailExistJson = json_encode($EmailExistMSG);
 echo $EmailExistJson ; 

}

And this is my react native script where i should enter number and fetch his data if it's exist in my database:

search= () =>{
     //alert('ok');
     const {numero}=this.state;

     fetch('http://192.168.1.4:80/search.php',{
     method:'post',
     header:{
     'Accept':'application/json',
     'Content-type' :'application/json'
     },
     body:JSON.stringify({numero:numero})}).then((responseData)=>responseData.json()).then((responseJson)=>{alert(responseJson)}).catch((error)=>{console.error(error);})}

  render(){
    return(

          <View style={styles.pass}>
          <TextInput placeholder="Saisir le numéro de suivi de l'envoi"   onChangeText= {numero=>this.setState({numero})}/>
          <TouchableOpacity onPress={this.search} style={{marginTop:20,marginLeft:70}}>
          <Icon name="search"  size={20}/>
          </TouchableOpacity>
          </View>

    )
  }
read less
Answers 1 Comments
Dislike Bookmark

About UrbanPro

UrbanPro.com helps you to connect with the best BCA Tuition in India. Post Your Requirement today and get connected.

Overview

Questions 171

Lessons 33

Total Shares  

+ Follow 35,842 Followers

You can also Learn

Top Contributors

Connect with Expert Tutors & Institutes for Java Programming

x

Ask a Question

Please enter your Question

Please select a Tag

X

Looking for BCA Tuition Classes?

The best tutors for BCA Tuition Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Take BCA Tuition with the Best Tutors

The best Tutors for BCA Tuition Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more