Core Java Programming Challenges #8 | Coding Challenges | Naresh IT

preview_player
Показать описание
Core Java Programming Challenges #1 | Coding Challenges | Naresh IT

💡 Also Watch

Java Programming Tutorials by Mr.Hari krishna:
Advanced Java Programming Tutorials by Mr.Nataraj:

Subscribe to our channel and hit the bell 🔔🔔🔔 icon to get video updates.

💡 Visit Our Websites
#CoreJava_Programing #Challenges #CoreJava #Quiz
--------------------------

💡 About NareshIT:

"Naresh IT is having 14+ years of experience in software training industry and the best Software Training Institute for online training, classroom training, weekend training, corporate training of Hadoop, Salesforce, AWS, DevOps, Spark, Data Science, Python, Tableau, RPA , Java, C#.NET, ASP.NET, Oracle, Testing Tools, Silver light, Linq, SQL Server, Selenium, Android, iPhone, C Language, C++, PHP and Digital Marketing in USA, Hyderabad, Chennai and Vijayawada, Bangalore India which provides online training across all the locations

--------------------------

💡 Our Online Training Features:
🎈 Training with Real-Time Experts
🎈 Industry Specific Scenario’s
🎈 Flexible Timings
🎈 Soft Copy of Material
🎈 Share Videos of each and every session.

--------------------------

💡 Please write back to us at

--------------------------

💡 Check The Below Links

Рекомендации по теме
Комментарии
Автор

package nareshiTechnology;

public class Exam08 {

public void m1()
{
System.out.println("I am in m1");
}
public static void m2()
{
System.out.println("I am in static m2");
}
public void access()
{
this.m1();
this.m2();
System.out.println("I am in access method.");

}

public static void main(String[] args)
{

Exam08 obj=new Exam08();
obj.access();
}

}
/* Output:-
I am in m1
I am in static m2
I am in access method.
*/

chetankhatal
Автор

Hi, I am able to access static method without using this keyword also. Please find the code below.

public class Pratices {

void access() {
System.out.println("I am controlling both static and non static");
access1();
this.access2();

}


public static void main(String[] args) {

Pratices p = new Pratices();
p.access();

}
static void access1() {
System.out.println("I am from static access");
}

void access2() {
System.out.println("I am from non static access");
}

}

Output:

I am controlling both static and non static
I am from static access
I am from non static access
.

t.ajithkumar
Автор

class Test{
void access(){
this.m1();
this.m2();
}
static void m1(){
System.out.println("Static m1 method");
}
void m2(){
m2 method");
}
public static void main(String s[]){
Test t=new Test();
t.access();
}
}

renukadevi
Автор

public class Challenge8 {
public void access()
{
System.out.println("this is access method");
this.m1();
this.m2();
}
public static void m1()
{
System.out.println("Static method");
}
public void m2()
{
System.out.println("Non static method");
}
public static void main(String[] args) {
System.out.println("this is main method");
Challenge8 ch=new Challenge8();
ch.access();
}

}

SubhamKumar-wbcj
Автор

public class Challange8 {
static void m1()
{
System.out.println("hey this is static");
}
void m2()
{
System.out.println("hey this is non static");
}
void m3()
{
this.m1();
this.m2();
System.out.println("usage of this keyword shown");
}
public static void main(String[] args) {
Challange8 c=new Challange8();
c.m3();
}
}

rohanjha
Автор

public class Challenge8
{

public static void main(String[] args)
{
Challenge8 ch=new Challenge8();
ch.access();

}
void access()
{
this.m1();
this.m2();
}
static void m1()
{
System.out.println("static method m1 invoked");
}
void m2()
{
m2 invoked");
}
}

danyalaabid
Автор

package com.nit.challaenges;
public class Challenge_8 {
static void m1() {
System.out.println(" this is a Static method M1");
}
void m2() {
System.out.println(" this is Non-Static method M2");
}
void access() {
this.m1();
this.m2();
}
public static void main(String[] args) {
System.out.println("main Starts");
Challenge_8 ch= new Challenge_8();
ch.access();
System.out.println("main ends");
}

}

chinthapallibalaji
Автор

public class Test {

static {
System.out.println("static context");
}

{
this.m1();
this.m2();
System.out.println("non static context");
}

void m1() {
System.out.println("m1() accessed");
}
static void m2() {
System.out.println("m2() accessed");
}
public static void main(String[] args) {

Test t=new Test();

}
}

rohitjaiswal
Автор

public class ThisKeyword {

void access()
{
this.m1();
this.m2();
}
static void m1()
{
System.out.println("Static method");
}

void m2()
{
Method");
}

public static void main(String[] args) {
ThisKeyword t= new ThisKeyword();
t.access();
}

}

shilpar
Автор

public class Main
{
void m(){
m");
}

static void n(){
System.out.println("static m");

}
void access(){
this.m();
this.n();
System.out.println("access both");

}
public static void main(String[] args) {
Main m=new Main();
m.access();
}
}

shaktianand
Автор

public class Test {
static void main()
{
Test t = new Test();
t.access();
}
void access()
{

this.m1();
this.m2();
}
static void m1()
{
System.out.println("static method");
}
void m2()
{
System.out.println("non static method");
}

public static void main(String[] args)
{
Test.main();
}
}

pritipatil
Автор

class Test
{
static void m1()
{
System.out.println("static method");
}

void m2()
{
System.out.println("non static method");
}

void access()
{
System.out.println();
this.m1();
this.m2();
}

public static void main(String args[])
{
Test t=new Test();
t.access();

}
}

sreedharkamera
Автор

public class Index {

public static void main(String[]args)
{
Index obj= new Index();
obj.access();
}
public void access()
{
this.m1();
this.m2();
}
public void m1()
{
System.out.println("Non static method");
}
public static void m2()
{
System.out.println("Static Method ");
}
}

nishantraj
Автор

public class Test{

static int i=10;

String s="ABC";

public static void m1()
{
System.out.println("Static Method m1");
}

public void m2()
{
Method m2");
}

public void access()
{



this.m1();
this.m2();
}

public static void main(String [] args)
{
Test t=new Test();
t.access();

}
}

cricbuffofficial
Автор

class Main
{
public static void main(String args[])
{
Main m=new Main();
m.access();
}
void access()
{
this.methodstatic();
this.methodnonstatic();
}
static void methodstatic()
{
System.out.println("static method");
}
void methodnonstatic()
{
System.out.println("non static method");
}
}

sravyarani
Автор

public class c6 {
static void m1() {
System.out.println("this is static meth1 ");
}
void m2() {
meth2 ");
}
void access() {
this.m1();
this.m2();
}
public static void main(String[] args)
{
new c6().access();
}
}

nandajoshi
Автор

class Challenge8 {

static void m1(){
System.out.println("Static method");
}

void m2(){
System.out.println("Non static method");
}

void access(){
this.m1();
this.m2();
}
public static void main(String[] args)
{
Challenge8 ch=new Challenge8();
ch.access();
}
}

Yogesh-ldjs
Автор

package coreJava.chalanges;
//this keyword
public class Ch8 {
int x=10;
void show()
{
System.out.println("this is show method"+x);
this.m1();
this.m2();
m1(); // static methods can be called with out this...

}
static void m1()
{
System.out.println("Static method..");
}
void m2()
{
x=100;
method.."+x);
}


public static void main(String[] args) {
// TODO Auto-generated method stub
Ch8 c= new Ch8();
c.show();

}

}

sayyedwaliullah
Автор

public class Challenge8 {
public static void main(String[] args) {
Challenge8 ch = new Challenge8();
ch.access();
}

void access(){
System.out.println("calling access");
this.m1();
this.m2();
}

static void m1(){
System.out.println("calling static method");
}

void m2(){
System.out.println("calling non static");
}
}

samahmahdi
Автор

public class Challenge8 {
public static void main(String[] args) {
Challenge8 ch8 = new Challenge8();
ch8.access();
}

void access() {
this.m1();
this.m2();
}
static void m1() {
System.out.println("Static Method");
}
void m2() {
System.out.println("Non Static Method");
}
}

karangorai
visit shbcf.ru